mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-18 19:00:15 +00:00
Pass along exit code when running a sub-script, instead of always running exit 0
This commit is contained in:
parent
9131f2754a
commit
be692a8782
4 changed files with 22 additions and 22 deletions
|
@ -143,7 +143,7 @@ main(){
|
||||||
:
|
:
|
||||||
elif [ "$UpdateCmd" = "Update" ]; then
|
elif [ "$UpdateCmd" = "Update" ]; then
|
||||||
$SUDO ${pivpnScriptDir}/update.sh "$@"
|
$SUDO ${pivpnScriptDir}/update.sh "$@"
|
||||||
exit 0
|
exit "$?"
|
||||||
elif [ "$UpdateCmd" = "Repair" ]; then
|
elif [ "$UpdateCmd" = "Repair" ]; then
|
||||||
# shellcheck disable=SC1090
|
# shellcheck disable=SC1090
|
||||||
source "$setupVars"
|
source "$setupVars"
|
||||||
|
|
|
@ -16,18 +16,18 @@ vpn="openvpn"
|
||||||
function makeOVPNFunc {
|
function makeOVPNFunc {
|
||||||
shift
|
shift
|
||||||
$SUDO ${scriptDir}/${vpn}/makeOVPN.sh "$@"
|
$SUDO ${scriptDir}/${vpn}/makeOVPN.sh "$@"
|
||||||
exit 0
|
exit "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
function listClientsFunc {
|
function listClientsFunc {
|
||||||
shift
|
shift
|
||||||
$SUDO ${scriptDir}/${vpn}/clientStat.sh "$@"
|
$SUDO ${scriptDir}/${vpn}/clientStat.sh "$@"
|
||||||
exit 0
|
exit "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
function listOVPNFunc {
|
function listOVPNFunc {
|
||||||
$SUDO ${scriptDir}/${vpn}/listOVPN.sh
|
$SUDO ${scriptDir}/${vpn}/listOVPN.sh
|
||||||
exit 0
|
exit "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
function debugFunc {
|
function debugFunc {
|
||||||
|
@ -37,29 +37,29 @@ function debugFunc {
|
||||||
echo "::: Debug output completed above."
|
echo "::: Debug output completed above."
|
||||||
echo "::: Copy saved to /tmp/debug.log"
|
echo "::: Copy saved to /tmp/debug.log"
|
||||||
echo "::: "
|
echo "::: "
|
||||||
exit 0
|
exit "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeOVPNFunc {
|
function removeOVPNFunc {
|
||||||
shift
|
shift
|
||||||
$SUDO ${scriptDir}/${vpn}/removeOVPN.sh "$@"
|
$SUDO ${scriptDir}/${vpn}/removeOVPN.sh "$@"
|
||||||
exit 0
|
exit "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
function uninstallFunc {
|
function uninstallFunc {
|
||||||
$SUDO ${scriptDir}/uninstall.sh "${vpn}"
|
$SUDO ${scriptDir}/uninstall.sh "${vpn}"
|
||||||
exit 0
|
exit "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
function update {
|
function update {
|
||||||
shift
|
shift
|
||||||
$SUDO ${scriptDir}/update.sh "$@"
|
$SUDO ${scriptDir}/update.sh "$@"
|
||||||
exit 0
|
exit "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
function backup {
|
function backup {
|
||||||
$SUDO ${scriptDir}/backup.sh "${vpn}"
|
$SUDO ${scriptDir}/backup.sh "${vpn}"
|
||||||
exit 0
|
exit "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,12 +14,12 @@ scriptDir="/opt/pivpn"
|
||||||
|
|
||||||
uninstallServer(){
|
uninstallServer(){
|
||||||
$SUDO ${scriptDir}/uninstall.sh
|
$SUDO ${scriptDir}/uninstall.sh
|
||||||
exit 0
|
exit "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
backup(){
|
backup(){
|
||||||
$SUDO ${scriptDir}/backup.sh
|
$SUDO ${scriptDir}/backup.sh
|
||||||
exit 0
|
exit "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
showHelp(){
|
showHelp(){
|
||||||
|
|
|
@ -16,13 +16,13 @@ vpn="wireguard"
|
||||||
makeConf(){
|
makeConf(){
|
||||||
shift
|
shift
|
||||||
$SUDO ${scriptdir}/${vpn}/makeCONF.sh "$@"
|
$SUDO ${scriptdir}/${vpn}/makeCONF.sh "$@"
|
||||||
exit 0
|
exit "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
listConnected(){
|
listConnected(){
|
||||||
shift
|
shift
|
||||||
$SUDO ${scriptdir}/${vpn}/clientSTAT.sh "$@"
|
$SUDO ${scriptdir}/${vpn}/clientSTAT.sh "$@"
|
||||||
exit 0
|
exit "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
debug(){
|
debug(){
|
||||||
|
@ -32,52 +32,52 @@ debug(){
|
||||||
echo "::: Debug output completed above."
|
echo "::: Debug output completed above."
|
||||||
echo "::: Copy saved to /tmp/debug.log"
|
echo "::: Copy saved to /tmp/debug.log"
|
||||||
echo "::: "
|
echo "::: "
|
||||||
exit 0
|
exit "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
listClients(){
|
listClients(){
|
||||||
$SUDO ${scriptdir}/${vpn}/listCONF.sh
|
$SUDO ${scriptdir}/${vpn}/listCONF.sh
|
||||||
exit 0
|
exit "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
showQrcode(){
|
showQrcode(){
|
||||||
shift
|
shift
|
||||||
$SUDO ${scriptdir}/${vpn}/qrcodeCONF.sh "$@"
|
$SUDO ${scriptdir}/${vpn}/qrcodeCONF.sh "$@"
|
||||||
exit 0
|
exit "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
removeClient(){
|
removeClient(){
|
||||||
shift
|
shift
|
||||||
$SUDO ${scriptdir}/${vpn}/removeCONF.sh "$@"
|
$SUDO ${scriptdir}/${vpn}/removeCONF.sh "$@"
|
||||||
exit 0
|
exit "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
disableClient(){
|
disableClient(){
|
||||||
shift
|
shift
|
||||||
$SUDO ${scriptdir}/${vpn}/disableCONF.sh "$@"
|
$SUDO ${scriptdir}/${vpn}/disableCONF.sh "$@"
|
||||||
exit 0
|
exit "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
enableClient(){
|
enableClient(){
|
||||||
shift
|
shift
|
||||||
$SUDO ${scriptdir}/${vpn}/enableCONF.sh "$@"
|
$SUDO ${scriptdir}/${vpn}/enableCONF.sh "$@"
|
||||||
exit 0
|
exit "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
uninstallServer(){
|
uninstallServer(){
|
||||||
$SUDO ${scriptdir}/uninstall.sh "${vpn}"
|
$SUDO ${scriptdir}/uninstall.sh "${vpn}"
|
||||||
exit 0
|
exit "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
updateScripts(){
|
updateScripts(){
|
||||||
shift
|
shift
|
||||||
$SUDO ${scriptdir}/update.sh "$@"
|
$SUDO ${scriptdir}/update.sh "$@"
|
||||||
exit 0
|
exit "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
backup(){
|
backup(){
|
||||||
$SUDO ${scriptdir}/backup.sh "${vpn}"
|
$SUDO ${scriptdir}/backup.sh "${vpn}"
|
||||||
exit 0
|
exit "$?"
|
||||||
}
|
}
|
||||||
|
|
||||||
showHelp(){
|
showHelp(){
|
||||||
|
|
Loading…
Reference in a new issue