From 6d50814c1971c9cfaf3c487124797676e138d4ba Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Thu, 5 May 2022 09:29:46 -0400 Subject: [PATCH] Build: Make --install and --uninstall mutually exclusive --- build_scripts/appimage/install-infection-monkey-service.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build_scripts/appimage/install-infection-monkey-service.sh b/build_scripts/appimage/install-infection-monkey-service.sh index 2ecf6729d..450fe0a60 100755 --- a/build_scripts/appimage/install-infection-monkey-service.sh +++ b/build_scripts/appimage/install-infection-monkey-service.sh @@ -99,6 +99,7 @@ exit_if_missing_argument() { } do_uninstall=false +do_install=false username="" while (( "$#" )); do @@ -109,6 +110,7 @@ while (( "$#" )); do shift 2 ;; --install) + do_install=true shift ;; --uninstall) @@ -137,6 +139,11 @@ if [ -z "${APPIMAGE}" ] ; then exit 1 fi +if $do_install && $do_uninstall ; then + echo "The --install and --uninstall flags are mutually exclusive." + exit 1 +fi + if $do_uninstall ; then uninstall_service exit 0