From b2343bfa0b1f0773b8cdafa18bfbe2ae96988a7f Mon Sep 17 00:00:00 2001 From: Pynx Echaup <33941693+echaupynx@users.noreply.github.com> Date: Thu, 19 Jul 2018 15:26:50 +0200 Subject: [PATCH] Create updateConfigs.sh for Nordvpn Added updateConfigs.sh file in the nordvpn directory, so the .ovpn files will be automatically updated regularly. --- openvpn/nordvpn/updateConfigs.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 openvpn/nordvpn/updateConfigs.sh diff --git a/openvpn/nordvpn/updateConfigs.sh b/openvpn/nordvpn/updateConfigs.sh new file mode 100644 index 000000000..e6733843c --- /dev/null +++ b/openvpn/nordvpn/updateConfigs.sh @@ -0,0 +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 + +#move files from folder ovpn_tcp and ovpn_udp, then remove the directory +#mv ./ovpn_tcp/* ./ +#mv ./ovpn_udp/* ./ +#rmdir ovpn_tcp ovpn_udp + +# Ensure linux line endings +#dos2unix * + +# Update configs with correct paths +sed -i "s/auth-user-pass/auth-user-pass \/config\/openvpn-credentials.txt/" *.ovpn + +# Create symlink for default.ovpn +ln -s nl8.nordvpn.com.tcp.ovpn default.ovpn