This repository has been archived on 2023-08-13. You can view files and clone it, but cannot push or open issues or pull requests.
nas-server/dl-server/install.sh

27 lines
1.0 KiB
Bash
Raw Permalink Normal View History

2022-06-06 15:15:13 +02:00
#!/usr/bin/env bash
2022-09-22 18:54:49 +02:00
run_directory=$(dirname $(readlink -f "$0"))
2022-06-06 15:15:13 +02:00
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/
2022-09-22 18:13:31 +02:00
sudo sed -i -e "s:PH_DIRECTORY:$(pwd):g" /etc/systemd/system/transmission-vpn.service
2022-06-06 15:15:13 +02:00
sudo cp $run_directory/transmission-vpn.timer /etc/systemd/system/
echo "Reloading Systemd..."
sudo systemctl daemon-reload
2022-06-06 15:15:13 +02:00
echo "Finished install. Exiting..."
exit 0