From 307fa4b0a8fd8391ae5be4caffd1252d9397b012 Mon Sep 17 00:00:00 2001 From: Matthieu Fronton Date: Thu, 16 Aug 2012 09:06:41 +0200 Subject: [PATCH] adding specific exit code variable for each error type --- install_yunohost | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/install_yunohost b/install_yunohost index fdc2fb5..12c7f55 100755 --- a/install_yunohost +++ b/install_yunohost @@ -5,6 +5,7 @@ ERR_FAIL_RESTORE=1 ERR_FAIL_UPDATE=2 ERR_FAIL_INSTALL=3 ERR_CANCEL_INSTALL=4 +ERR_IMPOSSIBLE=-1 function bck { FULLPATH="$(readlink -f "$1")" @@ -158,9 +159,13 @@ then service nscd restart service nslcd restart echo "======== Installation success ========" + exit $SUCCESS fi else echo "======== Installation cancelled ========" - exit 1 + exit $ERR_CANCEL_INSTALL fi + +# Security : we shouldn't be able to exit here +exit $ERR_IMPOSSIBLE