From b9c6c0f31479de274153955d7c997ebd9a2e933e Mon Sep 17 00:00:00 2001 From: Orazio Date: Tue, 19 Nov 2019 13:28:51 +0100 Subject: [PATCH] Fix exit codes --- scripts/openvpn/pivpn | 2 +- scripts/wireguard/pivpn | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/openvpn/pivpn b/scripts/openvpn/pivpn index 4d2317c..c18049f 100755 --- a/scripts/openvpn/pivpn +++ b/scripts/openvpn/pivpn @@ -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 diff --git a/scripts/wireguard/pivpn b/scripts/wireguard/pivpn index f4bcfd9..bd89d43 100755 --- a/scripts/wireguard/pivpn +++ b/scripts/wireguard/pivpn @@ -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