script for install as service

This commit is contained in:
mercury
2023-03-01 23:08:36 +04:00
parent b9afaa82d4
commit 65915e78f5
2 changed files with 15 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
cp scripts/vpnbot.service /etc/systemd/system/vpnbot.service
systemctl daemon-reload
systemctl enable vpnbot
+12
View File
@@ -0,0 +1,12 @@
[Unit]
Description=VPN: Docker Compose Application Service
Requires=docker.service
After=docker.service
[Service]
WorkingDirectory=/root/vpnbot
ExecStart=/bin/sh -c "RELEASE=$(lsb_release -rs) SYSTEM=$(lsb_release -is | tr '[:upper:]' '[:lower:]') docker compose up --build --force-recreate"
ExecStop=/usr/bin/docker compose down
TimeoutStartSec=0
Restart=on-failure
[Install]
WantedBy=multi-user.target