From 4a49787b28650a9ad84867f3cc11ea70303a7c4e Mon Sep 17 00:00:00 2001 From: Orazio Date: Tue, 21 Jan 2020 15:54:20 +0100 Subject: [PATCH] Changed variable name, corrected rm typo --- auto_install/install.sh | 16 ++++++++-------- scripts/openvpn/makeOVPN.sh | 4 ++-- scripts/uninstall.sh | 2 +- unattended_openvpn_example.conf | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 24b9eca..da79685 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -1473,8 +1473,8 @@ askPublicIPOrDNS(){ askEncryption(){ if [ "${runUnattended}" = 'true' ]; then - if [ -z "$pivpnTWOPOINTFOUR" ] || [ "$pivpnTWOPOINTFOUR" -eq 1 ]; then - pivpnTWOPOINTFOUR=1 + if [ -z "$TWO_POINT_FOUR" ] || [ "$TWO_POINT_FOUR" -eq 1 ]; then + TWO_POINT_FOUR=1 echo "::: Using OpenVPN 2.4 features" if [ -z "$pivpnENCRYPT" ]; then @@ -1489,7 +1489,7 @@ askEncryption(){ fi fi else - pivpnTWOPOINTFOUR=0 + TWO_POINT_FOUR=0 echo "::: Using traditional OpenVPN configuration" if [ -z "$pivpnENCRYPT" ]; then @@ -1512,21 +1512,21 @@ askEncryption(){ fi fi - echo "pivpnTWOPOINTFOUR=${pivpnTWOPOINTFOUR}" >> /tmp/setupVars.conf + echo "TWO_POINT_FOUR=${TWO_POINT_FOUR}" >> /tmp/setupVars.conf echo "pivpnENCRYPT=${pivpnENCRYPT}" >> /tmp/setupVars.conf echo "DOWNLOAD_DH_PARAM=${DOWNLOAD_DH_PARAM}" >> /tmp/setupVars.conf return fi if (whiptail --backtitle "Setup OpenVPN" --title "Installation mode" --yesno "OpenVPN 2.4 can take advantage of Elliptic Curves to provide higher connection speed and improved security over RSA, while keeping smaller certificates.\\n\\nMoreover, the 'tls-crypt' directive encrypts the certificates being used while authenticating, increasing privacy.\\n\\nIf your clients do run OpenVPN 2.4 or later you can enable these features, otherwise choose 'No' for best compatibility." "${r}" "${c}"); then - pivpnTWOPOINTFOUR=1 + TWO_POINT_FOUR=1 pivpnENCRYPT=$(whiptail --backtitle "Setup OpenVPN" --title "ECDSA certificate size" --radiolist \ "Choose the desired size of your certificate (press space to select):\\nThis is a certificate that will be generated on your system. The larger the certificate, the more time this will take. For most applications, it is recommended to use 256 bits. You can increase the number of bits if you care about, however, consider that 256 bits are already as secure as 3072 bit RSA." ${r} ${c} 3 \ "256" "Use a 256-bit certificate (recommended level)" ON \ "384" "Use a 384-bit certificate" OFF \ "521" "Use a 521-bit certificate (paranoid level)" OFF 3>&1 1>&2 2>&3) else - pivpnTWOPOINTFOUR=0 + TWO_POINT_FOUR=0 pivpnENCRYPT=$(whiptail --backtitle "Setup OpenVPN" --title "RSA certificate size" --radiolist \ "Choose the desired size of your certificate (press space to select):\\nThis is a certificate that will be generated on your system. The larger the certificate, the more time this will take. For most applications, it is recommended to use 2048 bits. If you are paranoid about ... things... then grab a cup of joe and pick 4096 bits." ${r} ${c} 3 \ "2048" "Use a 2048-bit certificate (recommended level)" ON \ @@ -1546,7 +1546,7 @@ askEncryption(){ DOWNLOAD_DH_PARAM=0 fi - echo "pivpnTWOPOINTFOUR=${pivpnTWOPOINTFOUR}" >> /tmp/setupVars.conf + echo "TWO_POINT_FOUR=${TWO_POINT_FOUR}" >> /tmp/setupVars.conf echo "pivpnENCRYPT=${pivpnENCRYPT}" >> /tmp/setupVars.conf echo "DOWNLOAD_DH_PARAM=${DOWNLOAD_DH_PARAM}" >> /tmp/setupVars.conf } @@ -1583,7 +1583,7 @@ confOpenVPN(){ cd /etc/openvpn/easy-rsa || exit 1 - if [ "$pivpnTWOPOINTFOUR" -eq 1 ]; then + if [ "$TWO_POINT_FOUR" -eq 1 ]; then pivpnCERT="ec" pivpnTLSPROT="tls-crypt" else diff --git a/scripts/openvpn/makeOVPN.sh b/scripts/openvpn/makeOVPN.sh index dfe6b8f..ec89435 100755 --- a/scripts/openvpn/makeOVPN.sh +++ b/scripts/openvpn/makeOVPN.sh @@ -75,7 +75,7 @@ do DAYS="$_val" ;; -i|--iOS) - if [ "$pivpnTWOPOINTFOUR" -ne 1 ]; then + if [ "$TWO_POINT_FOUR" -ne 1 ]; then iOS=1 else echo "Sorry, can't generate iOS-specific configs for ECDSA certificates" @@ -391,7 +391,7 @@ else echo "" #Finally, append the tls Private Key - if [ "$pivpnTWOPOINTFOUR" -eq 1 ]; then + if [ "$TWO_POINT_FOUR" -eq 1 ]; then echo "" cat "${TA}" echo "" diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh index 21693dc..4546044 100755 --- a/scripts/uninstall.sh +++ b/scripts/uninstall.sh @@ -151,7 +151,7 @@ removeAll(){ elif [ "${i}" = "openvpn" ]; then if [ "$PLAT" = "Debian" ] || [ "$PLAT" = "Ubuntu" ]; then - rm -r /etc/apt/sources.list.d/pivpn-openvpn-repo.list + rm -f /etc/apt/sources.list.d/pivpn-openvpn-repo.list $PKG_MANAGER update &> /dev/null fi deluser openvpn diff --git a/unattended_openvpn_example.conf b/unattended_openvpn_example.conf index f95a2f2..f0094bc 100644 --- a/unattended_openvpn_example.conf +++ b/unattended_openvpn_example.conf @@ -7,8 +7,8 @@ pivpnPORT=1194 pivpnDNS1=9.9.9.9 pivpnDNS2=149.112.112.112 pivpnHOST=pivpn.example.com -pivpnTWOPOINTFOUR=1 pivpnENCRYPT=256 pivpnSEARCHDOMAIN=searchdomain.example.com +TWO_POINT_FOUR=1 DOWNLOAD_DH_PARAM=0 UNATTUPG=1