finished main program, added no-root-check option

This commit is contained in:
fatalerrors
2021-07-20 15:35:53 +02:00
parent 83a41fd21c
commit 0a4029e60d
4 changed files with 19 additions and 3 deletions

View File

@@ -8,7 +8,7 @@ function die()
# Don't trigger the ERR signal as we already managed the error
trap - ERR
if [[ "$KEEPGOING" != "true" || "$2" == "--force" ]]; then
if [[ "$KEEPGOING" != "true" ]] || [[ "$2" == "--force" ]]; then
prnt E "Sortie prématuré avec erreur (code #$errorcode)."
exit $errorcode
else
@@ -83,6 +83,7 @@ function backtrace
check_root()
{
[[ $NO_ROOT_CHECK == true ]] && return 0
if [[ $EUID -ne 0 ]]; then
prnt E "Ce script doit être démarré en tant que root. Arrêt."
die 4 --force