From fc96e3aced4508d033082fe7f17efcaa52009367 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Thu, 5 May 2022 10:44:07 -0400 Subject: [PATCH] Build: Switch order of user_exists() and exit_if_user_doesnt_exist() --- .../appimage/install-infection-monkey-service.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build_scripts/appimage/install-infection-monkey-service.sh b/build_scripts/appimage/install-infection-monkey-service.sh index 272d6eb44..596dad010 100755 --- a/build_scripts/appimage/install-infection-monkey-service.sh +++ b/build_scripts/appimage/install-infection-monkey-service.sh @@ -83,16 +83,16 @@ uninstall_service() { echo "The Infection Monkey service has been uninstalled" } -user_exists() { - id -u "$1" &>/dev/null -} - exit_if_user_doesnt_exist() { if ! user_exists "$1" ; then die "Error: User '$1' does not exist." fi } +user_exists() { + id -u "$1" &>/dev/null +} + has_sudo() { # 0 true, 1 false sudo -nv > /dev/null 2>&1