adding specific exit code variable for each error type

This commit is contained in:
Matthieu Fronton 2012-08-16 09:06:41 +02:00
parent 3089dc1016
commit 307fa4b0a8

View file

@ -5,6 +5,7 @@ ERR_FAIL_RESTORE=1
ERR_FAIL_UPDATE=2 ERR_FAIL_UPDATE=2
ERR_FAIL_INSTALL=3 ERR_FAIL_INSTALL=3
ERR_CANCEL_INSTALL=4 ERR_CANCEL_INSTALL=4
ERR_IMPOSSIBLE=-1
function bck { function bck {
FULLPATH="$(readlink -f "$1")" FULLPATH="$(readlink -f "$1")"
@ -158,9 +159,13 @@ then
service nscd restart service nscd restart
service nslcd restart service nslcd restart
echo "======== Installation success ========" echo "======== Installation success ========"
exit $SUCCESS
fi fi
else else
echo "======== Installation cancelled ========" echo "======== Installation cancelled ========"
exit 1 exit $ERR_CANCEL_INSTALL
fi fi
# Security : we shouldn't be able to exit here
exit $ERR_IMPOSSIBLE