29 lines
735 B
Bash
29 lines
735 B
Bash
|
#!/usr/bin/bash
|
||
|
|
||
|
apt update
|
||
|
apt install -y tor python3-pip
|
||
|
sudo -H pip3 install stem paho-mqtt
|
||
|
|
||
|
sed -i '/^#ControlPort 9051/s/^#//' /etc/tor/torrc
|
||
|
sed -i '/^#CookieAuthentication 1/s/^#//' /etc/tor/torrc
|
||
|
echo "CookieAuthFileGroupReadable 1" >> /etc/tor/torrc
|
||
|
systemctl reload tor
|
||
|
|
||
|
useradd --system -g debian-tor torch
|
||
|
|
||
|
mkdir -p /etc/torch
|
||
|
cp torch.conf /etc/torch/
|
||
|
chown -R torch /etc/torch
|
||
|
|
||
|
mkdir -p /usr/local/lib/torch
|
||
|
mv torch-pub.py /usr/local/lib/torch/
|
||
|
chown root:root /usr/local/lib/torch/torch-pub.py
|
||
|
chmod 644 /usr/local/lib/torch/torch-pub.py
|
||
|
|
||
|
mv torch.service /etc/systemd/system/
|
||
|
chown root:root /etc/systemd/system/torch.service
|
||
|
chmod 644 /etc/systemd/system/torch.service
|
||
|
|
||
|
systemctl daemon-reload
|
||
|
systemctl enable torch
|