From e1b053f000bdf8e17fb785c17fc6c2adb5a0d448 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Thu, 5 May 2022 10:01:53 -0400 Subject: [PATCH] Build: Move move_appimage() for improved readability --- .../install-infection-monkey-service.sh | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/build_scripts/appimage/install-infection-monkey-service.sh b/build_scripts/appimage/install-infection-monkey-service.sh index 7f3baa69f..58934bc74 100755 --- a/build_scripts/appimage/install-infection-monkey-service.sh +++ b/build_scripts/appimage/install-infection-monkey-service.sh @@ -32,6 +32,16 @@ install_service() { Run 'systemctl start infection-monkey' to start the service now." } +move_appimage() { + sudo mkdir --mode=0755 -p "${MONKEY_BIN}" + + if [ "${APPIMAGE}" != "${MONKEY_BIN}/${APPIMAGE_NAME}" ] ; then + umask 022 + sudo cp "${APPIMAGE}" "${MONKEY_BIN}/${APPIMAGE_NAME}" + sudo chmod 755 "${MONKEY_BIN}/${APPIMAGE_NAME}" + fi +} + install_systemd_unit() { umask 077 cat > "${TMP_SYSTEMD_UNIT}" << EOF @@ -67,16 +77,6 @@ uninstall_service() { echo "The Infection Monkey service has been uninstalled" } -move_appimage() { - sudo mkdir --mode=0755 -p "${MONKEY_BIN}" - - if [ "${APPIMAGE}" != "${MONKEY_BIN}/${APPIMAGE_NAME}" ] ; then - umask 022 - sudo cp "${APPIMAGE}" "${MONKEY_BIN}/${APPIMAGE_NAME}" - sudo chmod 755 "${MONKEY_BIN}/${APPIMAGE_NAME}" - fi -} - user_exists() { id -u "$1" &>/dev/null }