Compare commits

..

2 Commits

Author SHA1 Message Date
mercury 3e3684eb34 fix service for systemd 2024-03-06 14:46:02 +04:00
mercury 7ee47db8e2 fix short link type 2024-03-06 11:52:09 +04:00
2 changed files with 8 additions and 5 deletions
+2 -2
View File
@@ -2232,7 +2232,7 @@ DNS-over-HTTPS with IP:
if (!empty($v['# PublicKey'])) {
$conf['peers'][$k]['online'] = 'off';
} else {
$conf['peers'][$k]['status'] = $this->getStatusPeer($v['PublicKey'], $status['peers']);
$conf['peers'][$k]['status'] = $status ? $this->getStatusPeer($v['PublicKey'], $status['peers']) : 'error';
$conf['peers'][$k]['online'] = preg_match('~^(\d+ seconds|[12] minute)~', $conf['peers'][$k]['status']['latest handshake']) ? 'online' : '';
}
}
@@ -2587,7 +2587,7 @@ DNS-over-HTTPS with IP:
if ($clients) {
$name = $this->getName($clients[$client]['interface']);
$conf = $this->createConfig($clients[$client]);
if ($this->getInstanceWG(1)) {
if ($this->getWGType() == 'awg') {
$sl = $this->getAmneziaShortLink($clients[$client]);
}
return [
+6 -3
View File
@@ -3,10 +3,13 @@ Description=VPN: Docker Compose Application Service
Requires=docker.service
After=docker.service
[Service]
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/root/vpnbot
ExecStart=/bin/sh -c "IP=$(curl https://ipinfo.io/ip) VER=$(git describe --tags) docker compose up -d --force-recreate && bash ./update/update.sh &"
ExecStop=/bin/sh -c "kill -9 $(cat ./update/update_pid) > /dev/null && docker compose down --remove-orphans"
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"
ExecStopPost=/bin/sh -c "kill -9 $(cat ./update/update_pid) > /dev/null"
TimeoutStartSec=0
Restart=on-failure
[Install]
WantedBy=multi-user.target