From f47d78b0f1ad91345e66b1a5852c0111fd9f3e56 Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Thu, 21 Jan 2016 02:12:30 -0600 Subject: [PATCH] Improve the process of defining VPN variables - Put variables inside single quotes to avoid escaping them - Make clear which characters should not be used in values Thanks for your helpful suggestions, @Langleson ! --- vpnsetup.sh | 13 +++++++------ vpnsetup_centos.sh | 13 +++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/vpnsetup.sh b/vpnsetup.sh index 6b65f47..bb2b413 100644 --- a/vpnsetup.sh +++ b/vpnsetup.sh @@ -24,13 +24,14 @@ if [ "$(uname)" = "Darwin" ]; then fi # Please define your own values for these variables -# Escape *all* non-alphanumeric characters with a backslash (3 backslashes for \ and "). -# Examples: \ --> \\\\, " --> \\\", ' --> \', $ --> \$, ` --> \`, [space] --> \[space] -IPSEC_PSK=your_very_secure_key -VPN_USER=your_username -VPN_PASSWORD=your_very_secure_password +# - All values MUST be quoted using 'single quotes' +# - DO NOT use these characters inside values: \ " ' -# IMPORTANT: Be sure to read important notes at the URL below: +IPSEC_PSK='your_ipsec_pre_shared_key' +VPN_USER='your_vpn_username' +VPN_PASSWORD='your_very_secure_password' + +# Be sure to read *important notes* at the URL below: # https://github.com/hwdsl2/setup-ipsec-vpn#important-notes if [ "$(lsb_release -si 2>/dev/null)" != "Ubuntu" ] && [ "$(lsb_release -si 2>/dev/null)" != "Debian" ]; then diff --git a/vpnsetup_centos.sh b/vpnsetup_centos.sh index 1f1b34c..1e1c2b4 100644 --- a/vpnsetup_centos.sh +++ b/vpnsetup_centos.sh @@ -23,13 +23,14 @@ if [ "$(uname)" = "Darwin" ]; then fi # Please define your own values for these variables -# Escape *all* non-alphanumeric characters with a backslash (3 backslashes for \ and "). -# Examples: \ --> \\\\, " --> \\\", ' --> \', $ --> \$, ` --> \`, [space] --> \[space] -IPSEC_PSK=your_very_secure_key -VPN_USER=your_username -VPN_PASSWORD=your_very_secure_password +# - All values MUST be quoted using 'single quotes' +# - DO NOT use these characters inside values: \ " ' -# IMPORTANT: Be sure to read important notes at the URL below: +IPSEC_PSK='your_ipsec_pre_shared_key' +VPN_USER='your_vpn_username' +VPN_PASSWORD='your_very_secure_password' + +# Be sure to read *important notes* at the URL below: # https://github.com/hwdsl2/setup-ipsec-vpn#important-notes if [ ! -f /etc/redhat-release ]; then