bash_completion not used in dual

This commit is contained in:
Ubuntu 2020-05-13 19:49:48 +00:00
parent 4e3a57b9aa
commit e700cf1c8f

View file

@ -13,7 +13,7 @@
######## VARIABLES ######### ######## VARIABLES #########
#pivpnGitUrl="https://github.com/pivpn/pivpn.git" #pivpnGitUrl="https://github.com/pivpn/pivpn.git"
pivpnGitUrl="/home/pi/repos/pivpn" pivpnGitUrl="/home/ubuntu/repos/pivpn"
setupVarsFile="setupVars.conf" setupVarsFile="setupVars.conf"
setupConfigDir="/etc/pivpn" setupConfigDir="/etc/pivpn"
tempsetupVarsFile="/tmp/setupVars.conf" tempsetupVarsFile="/tmp/setupVars.conf"
@ -2249,16 +2249,25 @@ installScripts(){
else else
othervpn='wireguard' othervpn='wireguard'
fi fi
if [ -r "${setupConfigDir}/${othervpn}/${setupVarsFile}" ]; then if [ -r "${setupConfigDir}/${othervpn}/${setupVarsFile}" ]; then
# both are installed
# dont need a link, copy the common script to the location instead # dont need a link, copy the common script to the location instead
$SUDO rm -f /usr/local/bin/pivpn $SUDO rm -f /usr/local/bin/pivpn
$SUDO install -m 755 -t /usr/local/bin /${pivpnFilesDir}/scripts/pivpn $SUDO install -m 755 -t /usr/local/bin /${pivpnFilesDir}/scripts/pivpn
fi fi
$SUDO cp "${pivpnFilesDir}/scripts/${VPN}/bash-completion" /etc/bash_completion.d/pivpn
$SUDO chown root:root /etc/bash_completion.d/pivpn if [ -r "${setupConfigDir}/${othervpn}/${setupVarsFile}" ]; then
$SUDO chmod 755 /etc/bash_completion.d/pivpn # both are installed, no bash completion, delete if already there
# shellcheck disable=SC1091 $SUDO rm -f /etc/bash_completion.d/pivpn
. /etc/bash_completion.d/pivpn else
# only one protocol is installed, put bash completion in place
$SUDO cp "${pivpnFilesDir}/scripts/${VPN}/bash-completion" /etc/bash_completion.d/pivpn
$SUDO chown root:root /etc/bash_completion.d/pivpn
$SUDO chmod 755 /etc/bash_completion.d/pivpn
# shellcheck disable=SC1091
. /etc/bash_completion.d/pivpn
fi
echo " done." echo " done."
} }