Restructure start script, extract provider specific scripts and add support for fetching configs from URL
This commit is contained in:
19
openvpn/nordvpn/configure-openvpn.sh
Executable file
19
openvpn/nordvpn/configure-openvpn.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#! /bin/bash
|
||||
|
||||
NORDVPN_PROTOCOL=${NORDVPN_PROTOCOL:-UDP}
|
||||
export NORDVPN_PROTOCOL
|
||||
|
||||
NORDVPN_CATEGORY=${NORDVPN_CATEGORY:-P2P}
|
||||
export NORDVPN_CATEGORY
|
||||
|
||||
|
||||
if [[ -n $OPENVPN_CONFIG ]]; then
|
||||
tmp_Protocol="${OPENVPN_CONFIG##*.}"
|
||||
export NORDVPN_PROTOCOL=${tmp_Protocol^^}
|
||||
echo "Setting NORDVPN_PROTOCOL to: ${NORDVPN_PROTOCOL}"
|
||||
${VPN_PROVIDER_HOME}/updateConfigs.sh --openvpn-config
|
||||
elif [[ -n $NORDVPN_COUNTRY ]]; then
|
||||
export OPENVPN_CONFIG=$(${VPN_PROVIDER_HOME}/updateConfigs.sh)
|
||||
else
|
||||
export OPENVPN_CONFIG=$(${VPN_PROVIDER_HOME}/updateConfigs.sh --get-recommended)
|
||||
fi
|
||||
@@ -110,7 +110,7 @@ download_hostname() {
|
||||
|
||||
log "Downloading config: ${ovpnName}"
|
||||
log "Downloading from: ${nordvpn_cdn}"
|
||||
curl ${nordvpn_cdn} -o "${ovpnName}"
|
||||
curl -sSL ${nordvpn_cdn} -o "${ovpnName}"
|
||||
}
|
||||
update_hostname() {
|
||||
log "Checking line endings"
|
||||
|
||||
Reference in New Issue
Block a user