From ec333aabaa70193f4e8395187956cfc8c2299b22 Mon Sep 17 00:00:00 2001 From: Alexandre CATTEAU Date: Thu, 17 Mar 2022 15:12:13 +0100 Subject: [PATCH] Add run_directory to install.sh --- install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index b6ea571..ed1e80d 100755 --- a/install.sh +++ b/install.sh @@ -1,13 +1,15 @@ #!/usr/bin/env bash +run_directory=$(dirname "$0") + if [ -f $run_directory/.disabled ]; then echo "Installation is disabled. Exiting..." exit 0 fi echo "Copying Systemd units to system directory..." -sudo cp $(dirname "$0")/systemd-templates/dns-update.service /etc/systemd/system/ -sudo cp $(dirname "$0")/systemd-templates/dns-update.timer /etc/systemd/system/ +sudo cp $run_directory/systemd-templates/dns-update.service /etc/systemd/system/ +sudo cp $run_directory/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_DIRECTORY:$(pwd):g" /etc/systemd/system/dns-update.service