Update start.sh

This commit is contained in:
MarkusMcNugen 2018-02-02 23:36:40 -05:00 committed by GitHub
parent 1601f402e6
commit cf18efc081
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -114,5 +114,19 @@ elif [[ $VPN_ENABLED == "no" ]]; then
echo "[warn] !!IMPORTANT!! You have set the VPN to disabled, you will NOT be secure!" | ts '%Y-%m-%d %H:%M:%.S' echo "[warn] !!IMPORTANT!! You have set the VPN to disabled, you will NOT be secure!" | ts '%Y-%m-%d %H:%M:%.S'
fi fi
# split comma seperated string into list from NAME_SERVERS env variable
IFS=',' read -ra name_server_list <<< "${NAME_SERVERS}"
# process name servers in the list
for name_server_item in "${name_server_list[@]}"; do
# strip whitespace from start and end of lan_network_item
name_server_item=$(echo "${name_server_item}" | sed -e 's~^[ \t]*~~;s~[ \t]*$~~')
echo "[info] Adding ${name_server_item} to resolv.conf"
echo "nameserver ${name_server_item}" >> /etc/resolv.conf
done
echo "[info] Starting OpenVPN..." echo "[info] Starting OpenVPN..."
exec openvpn --config "$VPN_CONFIG" exec openvpn --config "$VPN_CONFIG"