mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-18 19:00:15 +00:00
Merge pull request #1232 from glitch452/test
Fix exit codes when running a secondary script
This commit is contained in:
commit
cae160ebf9
5 changed files with 23 additions and 23 deletions
|
@ -143,7 +143,7 @@ main(){
|
|||
:
|
||||
elif [ "$UpdateCmd" = "Update" ]; then
|
||||
$SUDO ${pivpnScriptDir}/update.sh "$@"
|
||||
exit 0
|
||||
exit "$?"
|
||||
elif [ "$UpdateCmd" = "Repair" ]; then
|
||||
# shellcheck disable=SC1090
|
||||
source "$setupVars"
|
||||
|
|
|
@ -93,7 +93,7 @@ if [[ ! $EUID -eq 0 ]];then
|
|||
export SUDO="sudo"
|
||||
else
|
||||
echo "::: Please install sudo or run this as root."
|
||||
exit 0
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
@ -16,18 +16,18 @@ vpn="openvpn"
|
|||
function makeOVPNFunc {
|
||||
shift
|
||||
$SUDO ${scriptDir}/${vpn}/makeOVPN.sh "$@"
|
||||
exit 0
|
||||
exit "$?"
|
||||
}
|
||||
|
||||
function listClientsFunc {
|
||||
shift
|
||||
$SUDO ${scriptDir}/${vpn}/clientStat.sh "$@"
|
||||
exit 0
|
||||
exit "$?"
|
||||
}
|
||||
|
||||
function listOVPNFunc {
|
||||
$SUDO ${scriptDir}/${vpn}/listOVPN.sh
|
||||
exit 0
|
||||
exit "$?"
|
||||
}
|
||||
|
||||
function debugFunc {
|
||||
|
@ -37,29 +37,29 @@ function debugFunc {
|
|||
echo "::: Debug output completed above."
|
||||
echo "::: Copy saved to /tmp/debug.log"
|
||||
echo "::: "
|
||||
exit 0
|
||||
exit "$?"
|
||||
}
|
||||
|
||||
function removeOVPNFunc {
|
||||
shift
|
||||
$SUDO ${scriptDir}/${vpn}/removeOVPN.sh "$@"
|
||||
exit 0
|
||||
exit "$?"
|
||||
}
|
||||
|
||||
function uninstallFunc {
|
||||
$SUDO ${scriptDir}/uninstall.sh "${vpn}"
|
||||
exit 0
|
||||
exit "$?"
|
||||
}
|
||||
|
||||
function update {
|
||||
shift
|
||||
$SUDO ${scriptDir}/update.sh "$@"
|
||||
exit 0
|
||||
exit "$?"
|
||||
}
|
||||
|
||||
function backup {
|
||||
$SUDO ${scriptDir}/backup.sh "${vpn}"
|
||||
exit 0
|
||||
exit "$?"
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -14,12 +14,12 @@ scriptDir="/opt/pivpn"
|
|||
|
||||
uninstallServer(){
|
||||
$SUDO ${scriptDir}/uninstall.sh
|
||||
exit 0
|
||||
exit "$?"
|
||||
}
|
||||
|
||||
backup(){
|
||||
$SUDO ${scriptDir}/backup.sh
|
||||
exit 0
|
||||
exit "$?"
|
||||
}
|
||||
|
||||
showHelp(){
|
||||
|
|
|
@ -16,13 +16,13 @@ vpn="wireguard"
|
|||
makeConf(){
|
||||
shift
|
||||
$SUDO ${scriptdir}/${vpn}/makeCONF.sh "$@"
|
||||
exit 0
|
||||
exit "$?"
|
||||
}
|
||||
|
||||
listConnected(){
|
||||
shift
|
||||
$SUDO ${scriptdir}/${vpn}/clientSTAT.sh "$@"
|
||||
exit 0
|
||||
exit "$?"
|
||||
}
|
||||
|
||||
debug(){
|
||||
|
@ -32,52 +32,52 @@ debug(){
|
|||
echo "::: Debug output completed above."
|
||||
echo "::: Copy saved to /tmp/debug.log"
|
||||
echo "::: "
|
||||
exit 0
|
||||
exit "$?"
|
||||
}
|
||||
|
||||
listClients(){
|
||||
$SUDO ${scriptdir}/${vpn}/listCONF.sh
|
||||
exit 0
|
||||
exit "$?"
|
||||
}
|
||||
|
||||
showQrcode(){
|
||||
shift
|
||||
$SUDO ${scriptdir}/${vpn}/qrcodeCONF.sh "$@"
|
||||
exit 0
|
||||
exit "$?"
|
||||
}
|
||||
|
||||
removeClient(){
|
||||
shift
|
||||
$SUDO ${scriptdir}/${vpn}/removeCONF.sh "$@"
|
||||
exit 0
|
||||
exit "$?"
|
||||
}
|
||||
|
||||
disableClient(){
|
||||
shift
|
||||
$SUDO ${scriptdir}/${vpn}/disableCONF.sh "$@"
|
||||
exit 0
|
||||
exit "$?"
|
||||
}
|
||||
|
||||
enableClient(){
|
||||
shift
|
||||
$SUDO ${scriptdir}/${vpn}/enableCONF.sh "$@"
|
||||
exit 0
|
||||
exit "$?"
|
||||
}
|
||||
|
||||
uninstallServer(){
|
||||
$SUDO ${scriptdir}/uninstall.sh "${vpn}"
|
||||
exit 0
|
||||
exit "$?"
|
||||
}
|
||||
|
||||
updateScripts(){
|
||||
shift
|
||||
$SUDO ${scriptdir}/update.sh "$@"
|
||||
exit 0
|
||||
exit "$?"
|
||||
}
|
||||
|
||||
backup(){
|
||||
$SUDO ${scriptdir}/backup.sh "${vpn}"
|
||||
exit 0
|
||||
exit "$?"
|
||||
}
|
||||
|
||||
showHelp(){
|
||||
|
|
Loading…
Reference in a new issue