Check VPN credentials
- If the provided VPN credentials contain \ " or ', exit with error - The above special characters can cause issues with the VPN
This commit is contained in:
parent
cce15b7f08
commit
0e51150d84
@ -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).
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user