From e2eea482d0bacb8ef2fe43d8341fd4c198cf958e Mon Sep 17 00:00:00 2001 From: 4s3ti <4s3ti@protonmail.com> Date: Thu, 9 Jan 2020 00:22:15 +0100 Subject: [PATCH] Replace /etc/.pivpn/ with $pivpnFilesDir /etc/.pivpn/ is refferenced multiple times trough the script, Replaced all of them with $pivpnFilesDir Quoted some unquoted vars --- auto_install/install.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index f1267e7..4a0a74b 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -1578,7 +1578,7 @@ set_var EASYRSA_KEY_SIZE ${pivpnENCRYPT}" | $SUDO tee vars >/dev/null ${SUDOE} chown "$debianOvpnUserGroup" /etc/openvpn/crl.pem # Write config file for server using the template.txt file - $SUDO cp /etc/.pivpn/server_config.txt /etc/openvpn/server.conf + $SUDO cp $pivpnFilesDir/server_config.txt /etc/openvpn/server.conf # Apply client DNS settings ${SUDOE} sed -i '0,/\(dhcp-option DNS \)/ s/\(dhcp-option DNS \).*/\1'${pivpnDNS1}'\"/' /etc/openvpn/server.conf @@ -1612,7 +1612,7 @@ set_var EASYRSA_KEY_SIZE ${pivpnENCRYPT}" | $SUDO tee vars >/dev/null } confOVPN(){ - $SUDO cp /etc/.pivpn/Default.txt /etc/openvpn/easy-rsa/pki/Default.txt + $SUDO cp $pivpnFilesDir/Default.txt /etc/openvpn/easy-rsa/pki/Default.txt $SUDO sed -i 's/IPv4pub/'"$pivpnHOST"'/' /etc/openvpn/easy-rsa/pki/Default.txt @@ -1893,12 +1893,12 @@ installScripts(){ $SUDO chmod 0755 /opt/pivpn fi - $SUDO cp /etc/.pivpn/scripts/*.sh /opt/pivpn/ - $SUDO cp /etc/.pivpn/scripts/$VPN/*.sh /opt/pivpn/ + $SUDO cp $pivpnFilesDir/scripts/*.sh /opt/pivpn/ + $SUDO cp $pivpnFilesDir/scripts/$VPN/*.sh /opt/pivpn/ $SUDO chmod 0755 /opt/pivpn/*.sh - $SUDO cp /etc/.pivpn/scripts/$VPN/pivpn /usr/local/bin/pivpn + $SUDO cp $pivpnFilesDir/scripts/$VPN/pivpn /usr/local/bin/pivpn $SUDO chmod 0755 /usr/local/bin/pivpn - $SUDO cp /etc/.pivpn/scripts/$VPN/bash-completion /etc/bash_completion.d/pivpn + $SUDO cp $pivpnFilesDir/scripts/$VPN/bash-completion /etc/bash_completion.d/pivpn $SUDO chmod 0644 /etc/bash_completion.d/pivpn # shellcheck disable=SC1091 . /etc/bash_completion.d/pivpn