From a64fb84fc6a092305ccf44a9e342fc400a2e0488 Mon Sep 17 00:00:00 2001 From: DyonR Date: Fri, 22 Jan 2021 20:52:04 +0100 Subject: [PATCH] commenting out LEGACY_IPTABLES, fixed sentence, moved sleep used for wg-quick down --- openvpn/start.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/openvpn/start.sh b/openvpn/start.sh index 5020edf..642bcc8 100644 --- a/openvpn/start.sh +++ b/openvpn/start.sh @@ -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