diff --git a/vpnsetup.sh b/vpnsetup.sh index 5e3b24f..4ae281c 100755 --- a/vpnsetup.sh +++ b/vpnsetup.sh @@ -82,6 +82,12 @@ if [ -z "$VPN_IPSEC_PSK" ] || [ -z "$VPN_USER" ] || [ -z "$VPN_PASSWORD" ]; then exiterr "All VPN credentials must be specified. Edit the script and re-enter them." fi +case "$VPN_IPSEC_PSK $VPN_USER $VPN_PASSWORD" in + *[\\\"\']*) + exiterr "VPN credentials must not contain any of these characters: \\ \" '" + ;; +esac + if [ "$(sed 's/\..*//' /etc/debian_version 2>/dev/null)" = "7" ]; then cat <<'EOF' IMPORTANT: Workaround required for Debian 7 (Wheezy). diff --git a/vpnsetup_centos.sh b/vpnsetup_centos.sh index 8e97b5f..e815da0 100755 --- a/vpnsetup_centos.sh +++ b/vpnsetup_centos.sh @@ -85,6 +85,12 @@ if [ -z "$VPN_IPSEC_PSK" ] || [ -z "$VPN_USER" ] || [ -z "$VPN_PASSWORD" ]; then exiterr "All VPN credentials must be specified. Edit the script and re-enter them." fi +case "$VPN_IPSEC_PSK $VPN_USER $VPN_PASSWORD" in + *[\\\"\']*) + exiterr "VPN credentials must not contain any of these characters: \\ \" '" + ;; +esac + echo "VPN setup in progress... Please be patient." echo