Build: Move move_appimage() for improved readability

This commit is contained in:
Mike Salvatore 2022-05-05 10:01:53 -04:00
parent 88eb9dbe81
commit e1b053f000
1 changed files with 10 additions and 10 deletions

View File

@ -32,6 +32,16 @@ install_service() {
Run 'systemctl start infection-monkey' to start the service now." 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() { install_systemd_unit() {
umask 077 umask 077
cat > "${TMP_SYSTEMD_UNIT}" << EOF cat > "${TMP_SYSTEMD_UNIT}" << EOF
@ -67,16 +77,6 @@ uninstall_service() {
echo "The Infection Monkey service has been uninstalled" 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() { user_exists() {
id -u "$1" &>/dev/null id -u "$1" &>/dev/null
} }