From 11e34d8c4e1a303848a7af59e99666377c6a021d Mon Sep 17 00:00:00 2001 From: mercury Date: Wed, 6 Mar 2024 15:15:45 +0400 Subject: [PATCH] unversary path for vpnbot.service --- scripts/install_as_service.sh | 3 ++- scripts/vpnbot.service | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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"