diff --git a/scripts/install_as_service.sh b/scripts/install_as_service.sh index 00298e3..72e16c0 100644 --- a/scripts/install_as_service.sh +++ b/scripts/install_as_service.sh @@ -1,3 +1,4 @@ -cp scripts/vpnbot.service /etc/systemd/system/vpnbot.service +path=`pwd` +sed "s|path|$path|g" "$path/scripts/vpnbot.service" > /etc/systemd/system/vpnbot.service systemctl daemon-reload systemctl enable vpnbot diff --git a/scripts/vpnbot.service b/scripts/vpnbot.service index 983e29e..46196d0 100644 --- a/scripts/vpnbot.service +++ b/scripts/vpnbot.service @@ -5,7 +5,7 @@ After=docker.service [Service] Type=oneshot RemainAfterExit=yes -WorkingDirectory=/root/vpnbot +WorkingDirectory=path ExecStart=/bin/sh -c "IP=$(curl https://ipinfo.io/ip) VER=$(git describe --tags) docker compose up -d --force-recreate" ExecStartPost=/bin/sh -c "bash ./update/update.sh &" ExecStop=/bin/sh -c "docker compose down --remove-orphans"