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
Executable File

#!/usr/bin/env bash
run_directory=$(dirname $(readlink -f "$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