From 88eb9dbe817d9fb3f1c3bfa07c74c1d61b53b85e Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Thu, 5 May 2022 09:59:45 -0400 Subject: [PATCH] Build: Extract function install_systemd_unit() --- .../appimage/install-infection-monkey-service.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/build_scripts/appimage/install-infection-monkey-service.sh b/build_scripts/appimage/install-infection-monkey-service.sh index b09bf2001..7f3baa69f 100755 --- a/build_scripts/appimage/install-infection-monkey-service.sh +++ b/build_scripts/appimage/install-infection-monkey-service.sh @@ -25,7 +25,14 @@ echo_help() { install_service() { move_appimage + install_systemd_unit "$1" + + echo -e "The Infection Monkey service has been installed and will start on boot.\n\ +Run 'systemctl start infection-monkey' to start the service now." +} + +install_systemd_unit() { umask 077 cat > "${TMP_SYSTEMD_UNIT}" << EOF [Unit] @@ -43,9 +50,6 @@ EOF sudo mv "${TMP_SYSTEMD_UNIT}" "${SYSTEMD_DIR}/${SYSTEMD_UNIT_FILENAME}" sudo systemctl enable "${SYSTEMD_UNIT_FILENAME}" &>/dev/null - - echo -e "The Infection Monkey service has been installed and will start on boot.\n\ -Run 'systemctl start infection-monkey' to start the service now." } uninstall_service() {