Fix exit codes

This commit is contained in:
Orazio 2019-11-19 13:28:51 +01:00
parent 1ff6f7e9e8
commit b9c6c0f314
2 changed files with 9 additions and 9 deletions

View file

@ -6,7 +6,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

View file

@ -13,39 +13,39 @@ fi
makeConf(){
shift
$SUDO /opt/pivpn/makeCONF.sh "$@"
exit 1
exit 0
}
listConnected(){
$SUDO wg show
exit 1
exit 0
}
debug(){
$SUDO /opt/pivpn/pivpnDEBUG.sh
exit 1
exit 0
}
listClients(){
$SUDO /opt/pivpn/listCONF.sh
exit 1
exit 0
}
showQrcode(){
shift
$SUDO /opt/pivpn/qrcodeCONF.sh "$@"
exit 1
exit 0
}
removeClient(){
shift
$SUDO /opt/pivpn/removeCONF.sh "$@"
exit 1
exit 0
}
uninstallServer(){
$SUDO /opt/pivpn/uninstall.sh
exit 1
exit 0
}
showHelp(){
@ -62,7 +62,7 @@ showHelp(){
echo "::: -r, remove Remove a client"
echo "::: -h, help Show this help dialog"
echo "::: -u, uninstall Uninstall pivpn from your system!"
exit 1
exit 0
}
if [ $# = 0 ]; then