commenting out LEGACY_IPTABLES, fixed sentence, moved sleep used for wg-quick down
This commit is contained in:
parent
c0e5462fbf
commit
a64fb84fc6
@ -21,18 +21,18 @@ else
|
||||
export VPN_ENABLED="yes"
|
||||
fi
|
||||
|
||||
export LEGACY_IPTABLES=$(echo "${LEGACY_IPTABLES,,}")
|
||||
echo "[INFO] LEGACY_IPTABLES is set to '${LEGACY_IPTABLES}'" | ts '%Y-%m-%d %H:%M:%.S'
|
||||
if [[ $LEGACY_IPTABLES == "1" || $LEGACY_IPTABLES == "true" || $LEGACY_IPTABLES == "yes" ]]; then
|
||||
echo "[INFO] Linking /usr/sbin/iptables-legacy to /usr/sbin/iptables" | ts '%Y-%m-%d %H:%M:%.S'
|
||||
ln -sf /usr/sbin/iptables-legacy /usr/sbin/iptables > /dev/null 2>&1
|
||||
#echo "[INFO] Linking /usr/sbin/iptables-legacy-save to /usr/sbin/iptables-save" | ts '%Y-%m-%d %H:%M:%.S'
|
||||
#ln -sf /usr/sbin/iptables-legacy-save /usr/sbin/iptables-save > /dev/null 2>&1
|
||||
#echo "[INFO] Linking /usr/sbin/iptables-legacy-restore to /usr/sbin/iptables-restore" | ts '%Y-%m-%d %H:%M:%.S'
|
||||
#ln -sf /usr/sbin/iptables-legacy-restore /usr/sbin/iptables-restore > /dev/null 2>&1
|
||||
else
|
||||
echo "[INFO] Not making any changes to iptables" | ts '%Y-%m-%d %H:%M:%.S'
|
||||
fi
|
||||
# export LEGACY_IPTABLES=$(echo "${LEGACY_IPTABLES,,}")
|
||||
# echo "[INFO] LEGACY_IPTABLES is set to '${LEGACY_IPTABLES}'" | ts '%Y-%m-%d %H:%M:%.S'
|
||||
# if [[ $LEGACY_IPTABLES == "1" || $LEGACY_IPTABLES == "true" || $LEGACY_IPTABLES == "yes" ]]; then
|
||||
# echo "[INFO] Linking /usr/sbin/iptables-legacy to /usr/sbin/iptables" | ts '%Y-%m-%d %H:%M:%.S'
|
||||
# ln -sf /usr/sbin/iptables-legacy /usr/sbin/iptables > /dev/null 2>&1
|
||||
# echo "[INFO] Linking /usr/sbin/iptables-legacy-save to /usr/sbin/iptables-save" | ts '%Y-%m-%d %H:%M:%.S'
|
||||
# ln -sf /usr/sbin/iptables-legacy-save /usr/sbin/iptables-save > /dev/null 2>&1
|
||||
# echo "[INFO] Linking /usr/sbin/iptables-legacy-restore to /usr/sbin/iptables-restore" | ts '%Y-%m-%d %H:%M:%.S'
|
||||
# ln -sf /usr/sbin/iptables-legacy-restore /usr/sbin/iptables-restore > /dev/null 2>&1
|
||||
# else
|
||||
# echo "[INFO] Not making any changes to iptables" | ts '%Y-%m-%d %H:%M:%.S'
|
||||
# fi
|
||||
|
||||
if [[ $VPN_ENABLED == "yes" ]]; then
|
||||
# Check if VPN_TYPE is set.
|
||||
@ -232,7 +232,7 @@ if [[ $VPN_ENABLED == "yes" ]]; then
|
||||
fi
|
||||
|
||||
elif [[ $VPN_ENABLED == "no" ]]; then
|
||||
echo "[WARNING] !!IMPORTANT!! You have set the VPN to disabled, you will NOT be secure!" | ts '%Y-%m-%d %H:%M:%.S'
|
||||
echo "[WARNING] !!IMPORTANT!! You have set the VPN to disabled, your connection will NOT be secure!" | ts '%Y-%m-%d %H:%M:%.S'
|
||||
fi
|
||||
|
||||
|
||||
@ -269,8 +269,8 @@ if [[ $VPN_ENABLED == "yes" ]]; then
|
||||
cd /config/wireguard
|
||||
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
|
||||
sleep 0.5 # Just to give WireGuard a bit to go down
|
||||
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 &
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user