mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-18 19:00:15 +00:00
Fix directory and symbolic link creation when reconfiguring (writing over the same files)
This commit is contained in:
parent
308affe4e9
commit
dc744a9810
1 changed files with 5 additions and 5 deletions
|
@ -215,7 +215,7 @@ main(){
|
|||
# Save installation setting to the final location
|
||||
echo "INSTALLED_PACKAGES=(${INSTALLED_PACKAGES[*]})" >> ${tempsetupVarsFile}
|
||||
echo "::: Setupfiles copied to ${setupConfigDir}/${VPN}/${setupVarsFile}"
|
||||
$SUDO mkdir "${setupConfigDir}/${VPN}/"
|
||||
$SUDO mkdir -p "${setupConfigDir}/${VPN}/"
|
||||
$SUDO cp ${tempsetupVarsFile} "${setupConfigDir}/${VPN}/${setupVarsFile}"
|
||||
|
||||
installScripts
|
||||
|
@ -2288,13 +2288,13 @@ installScripts(){
|
|||
# Unlink the protocol specific pivpn script and symlink the common
|
||||
# script to the location instead
|
||||
$SUDO unlink /usr/local/bin/pivpn
|
||||
$SUDO ln -s -T "${pivpnFilesDir}/scripts/pivpn" /usr/local/bin/pivpn
|
||||
$SUDO ln -sf -T "${pivpnFilesDir}/scripts/pivpn" /usr/local/bin/pivpn
|
||||
else
|
||||
# Only one protocol is installed, symlink bash completion, the pivpn script
|
||||
# and the script directory
|
||||
$SUDO ln -s -T "${pivpnFilesDir}/scripts/${VPN}/bash-completion" /etc/bash_completion.d/pivpn
|
||||
$SUDO ln -s -T "${pivpnFilesDir}/scripts/${VPN}/pivpn.sh" /usr/local/bin/pivpn
|
||||
$SUDO ln -s "${pivpnFilesDir}/scripts/" "${pivpnScriptDir}"
|
||||
$SUDO ln -sf -T "${pivpnFilesDir}/scripts/${VPN}/bash-completion" /etc/bash_completion.d/pivpn
|
||||
$SUDO ln -sf -T "${pivpnFilesDir}/scripts/${VPN}/pivpn.sh" /usr/local/bin/pivpn
|
||||
$SUDO ln -sf "${pivpnFilesDir}/scripts/" "${pivpnScriptDir}"
|
||||
# shellcheck disable=SC1091
|
||||
. /etc/bash_completion.d/pivpn
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue