torch-agent/install-ubuntu2004.sh

29 lines
745 B
Bash
Executable File

#!/bin/bash
apt update
apt install -y tor python3-pip
sudo -H pip3 install stem paho-mqtt PySocks
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-agent.py /usr/local/lib/torch/
chown root:root /usr/local/lib/torch/torch-agent.py
chmod 644 /usr/local/lib/torch/torch-agent.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