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:
commit
3ff3d1f2ce
@ -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 &
|
||||
|
Loading…
x
Reference in New Issue
Block a user