Skip to content

Instantly share code, notes, and snippets.

@bspavel
Last active April 2, 2020 12:12
Show Gist options
  • Save bspavel/536f7f9484c146dab0cfe29eb454e2d8 to your computer and use it in GitHub Desktop.
Save bspavel/536f7f9484c146dab0cfe29eb454e2d8 to your computer and use it in GitHub Desktop.
the installer of transmission on the raspberry pi
#!/bin/bash
#https://geekelectronics.org/raspberry-pi/raspberry-pi-ustanovka-torrent.html
#https://pcminipro.ru/os/nastrojka-transmission-daemon-settings-json/
#https://help.ubuntu.ru/wiki/transmission-daemon
if [ "$(whoami)" != "root" ]; then
echo "Run script as ROOT please. (sudo !!!)"
exit
fi
sudo apt-get update
sudo apt-get -y upgrade
sudo rpi-update
sudo apt-get -y install transmission-daemon
# quietly add a user without password
#sudo adduser --quiet --disabled-password \
#--shell /bin/bash --home /home/newuser --gecos "User" torrent
#Add your non-root user to the transmission
#group (this is so you'll be able to have write
#permissions to the downloads directory)
sudo usermod -a -G debian-transmission torrent
sudo mkdir /home/torrent
sudo chown torrent -R /home/torrent
sudo /etc/init.d/transmission-daemon stop
#sudo systemctl stop transmission-daemon
sudo cat > /etc/transmission-daemon/settings.json << "EOF"
{
"blocklist-enabled": 0,
"download-dir": "\/home\/torrent",
"download-limit": 100,
"download-limit-enabled": 0,
"encryption": 1,
"max-peers-global": 200,
"peer-port": 51413,
"pex-enabled": 1,
"port-forwarding-enabled": 0,
"rpc-authentication-required": 1,
"rpc-password": "transmission",
"rpc-port": 9091,
"rpc-username": "transmission",
"rpc-whitelist": "127.0.0.1,192.168.0.*",
"rpc-enabled": true,
"peer-limit-global": 10,
"peer-limit-per-torrent": 5,
"download-queue-size": 1,
"cache-size-mb": 1,
"prefetch-enabled": 0,
"preallocation": 0,
"encryption": 0,
"dht-enabled": false,
"upload-limit": 100,
"upload-limit-enabled": 0
}
EOF
sudo /etc/init.d/transmission-daemon start
#sudo systemctl start transmission-daemon
echo "http://raspberrypi:9091"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment