27 lines
1020 B
Bash
Executable File
27 lines
1020 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
run_directory=$(dirname "$0")
|
|
|
|
source "$run_directory/variables.conf"
|
|
|
|
if [ -f $run_directory/.disabled ]; then
|
|
echo "Installation is disabled. Exiting..."
|
|
exit 0
|
|
fi
|
|
|
|
echo "Copying Systemd units to system directory..."
|
|
sudo cp $run_directory/transmission-daemon.service /etc/systemd/system/
|
|
sudo sed -i -e "s/PH_AUTHORIZED_ADDRESSES/$authorized_ips/g" /etc/systemd/system/transmission-daemon.service
|
|
sudo sed -i -e "s/PH_USER/$user/g" /etc/systemd/system/transmission-daemon.service
|
|
sudo sed -i -e "s/PH_PASSWORD/$password/g" /etc/systemd/system/transmission-daemon.service
|
|
sudo sed -i -e "s:PH_DL_LOCATION:$dl_location:g" /etc/systemd/system/transmission-daemon.service
|
|
sudo cp $run_directory/transmission-vpn.service /etc/systemd/system/
|
|
sudo sed -i -e "s:PH_DIRECTORY:$(pwd):g" /etc/systemd/system/transmission-vpn.service
|
|
sudo cp $run_directory/transmission-vpn.timer /etc/systemd/system/
|
|
|
|
echo "Reloading Systemd..."
|
|
sudo systemctl daemon-reload
|
|
|
|
echo "Finished install. Exiting..."
|
|
exit 0
|