install.sh: fix for working when called from outside repo

This commit is contained in:
Alexandre CATTEAU 2022-03-17 14:21:10 +01:00
parent f83b53baab
commit bf2122e08f

View File

@ -1,8 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
echo "Copying Systemd units to system directory..." echo "Copying Systemd units to system directory..."
sudo cp systemd-templates/dns-update.service /etc/systemd/system/ sudo cp $(dirname "$0")/systemd-templates/dns-update.service /etc/systemd/system/
sudo cp systemd-templates/dns-update.timer /etc/systemd/system/ sudo cp $(dirname "$0")/systemd-templates/dns-update.timer /etc/systemd/system/
sudo sed -i -e "s/PH_USER/$(whoami)/g" /etc/systemd/system/dns-update.service sudo sed -i -e "s/PH_USER/$(whoami)/g" /etc/systemd/system/dns-update.service
sudo sed -i -e "s:PH_DIRECTORY:$(pwd):g" /etc/systemd/system/dns-update.service sudo sed -i -e "s:PH_DIRECTORY:$(pwd):g" /etc/systemd/system/dns-update.service