Merge pull request #32 from cassidy3/patch-1

Prevent unnecessary message of `wg-quick down` before running `wg-quick up`
This commit is contained in:
DyonR 2021-01-19 17:20:55 +01:00 committed by GitHub
commit 3ff3d1f2ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -267,7 +267,9 @@ if [[ $VPN_ENABLED == "yes" ]]; then
else
echo "[INFO] Starting WireGuard..." | ts '%Y-%m-%d %H:%M:%.S'
cd /config/wireguard
wg-quick down $VPN_CONFIG || echo "WireGuard is down already" | ts '%Y-%m-%d %H:%M:%.S' # Run wg-quick down as an extra safeguard in case WireGuard is still up for some reason
if ip link | grep -q `basename -s .conf $VPN_CONFIG`; then
wg-quick down $VPN_CONFIG || echo "WireGuard is down already" | ts '%Y-%m-%d %H:%M:%.S' # Run wg-quick down as an extra safeguard in case WireGuard is still up for some reason
fi
sleep 0.5 # Just to give WireGuard a bit to go down
wg-quick up $VPN_CONFIG
#exec /bin/bash /etc/openvpn/openvpn.init start &