Hello everyone I would like to share with you this script which I made to install transmission on Ubuntu 16.04 server version because I always do some Stupid things on my server which cause me to reinstall the operating system to undo stupid things and that is because I don’t have any backup or snapshots.
The first thing I did was installing transmission manually than I figured that I could backup the settings.json file which is the most important file and write a script to install transmission and then copy the old settings.json file which was previously backed up from the server and then the script will do the whole thing in a matter of seconds instead of doing it manually in about 10 to 15 minutes.
sorry for hiding the password because I am not comfortable with including the Hashes of my password on a public server.
here is the code of the script:
#!/bin/bash sudo add-apt-repository ppa:transmissionbt/ppa -y sudo apt-get update -y sudo apt-get install transmission-cli transmission-common transmission-daemon -y sudo service transmission-daemon stop sudo cp settings.json /var/lib/transmission-daemon/info/ sudo cp stats.json /var/lib/transmission-daemon/info/ sudo service transmission-daemon start sudo usermod -a -G debian-transmission "USER" #change "USER" to your user name and try not to use the root privileged user sudo touch /home/"USER"/.bash_aliases sudo cat >> /home/"USER"/.bash_aliases alias t-start='sudo service transmission-daemon start' alias t-stop='sudo service transmission-daemon stop' alias t-reload='sudo service transmission-daemon reload' alias t-list='transmission-remote -n 'transmission:transmission' -l' alias t-basicstats='transmission-remote -n 'transmission:transmission' -st' alias t-fullstats='transmission-remote -n 'transmission:transmission' -si' ^D source /home/"USER"/.bash_aliases
I will be more than happy to see suggestions and thanks for reading this topic and being a member on fortmactech.com .