From baccca03e21b410612438a180ee4407cd28a2efc Mon Sep 17 00:00:00 2001 From: Pynx Echaup Date: Thu, 19 Jul 2018 15:41:16 +0200 Subject: [PATCH] made script executable chmod u+x updateConfigs.sh --- openvpn/nordvpn/updateConfigs.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) mode change 100644 => 100755 openvpn/nordvpn/updateConfigs.sh diff --git a/openvpn/nordvpn/updateConfigs.sh b/openvpn/nordvpn/updateConfigs.sh old mode 100644 new mode 100755 index 250157cb5..21f3050c4 --- a/openvpn/nordvpn/updateConfigs.sh +++ b/openvpn/nordvpn/updateConfigs.sh @@ -1,22 +1,27 @@ #!/bin/bash - + set -e - + # If the script is called from elsewhere cd "${0%/*}" - + # Delete everything (not this script though) find . ! -name '*.sh' -delete - + # Get updated configuration zip curl -kL https://downloads.nordcdn.com/configs/archives/servers/ovpn.zip -o openvpn.zip \ && unzip -j openvpn.zip && rm openvpn.zip # Ensure linux line endings #dos2unix * - -# Update configs with correct paths -sed -i "s/auth-user-pass/auth-user-pass \/config\/openvpn-credentials.txt/" *.ovpn - + +# Update configs with correct options +sed -i 's=auth-user-pass=auth-user-pass /config/openvpn-credentials.txt=g' *.ovpn +sed -i 's/ping 15/inactive 3600\ +ping 10/g' *.ovpn + +sed -i 's/ping-restart 0/ping-exit 60/g' *.ovpn +sed -i 's/ping-timer-rem//g' *.ovpn + # Create symlink for default.ovpn ln -s nl8.nordvpn.com.tcp.ovpn default.ovpn