Skip to content

Commit

Permalink
include root user check on uninstall script
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-borisoglebski committed Dec 7, 2023
1 parent 7465b7a commit b6d3423
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scripts/uninstallLobby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,20 @@ LOBBY_BIN_PATH=${LOBBY_BIN_DIR}/${LOBBY_BIN_NAME}
LOBBY_CONF_DIR='/etc/lobby'
LOBBY_ROOT_SERVICE_PATH='/etc/systemd/system/lobby.service'

RED='\033[0;31m'
NC='\033[0m' # No color

intro() {
echo Uninstalling Lobby
}

checkDeps() {
if [ "$(id -u)" -ne 0 ]; then
printf '%bThis uninstaller must be run as '\''root'\'' user%b\n\n' "$RED" "$NC"
exit 1
fi
}

deleteBin() {
if [ -f "$LOBBY_BIN_PATH" ]; then
rm -rf "$LOBBY_BIN_PATH"
Expand Down Expand Up @@ -39,6 +49,8 @@ outro() {

intro

checkDeps

deleteBin

deleteConf
Expand Down

0 comments on commit b6d3423

Please sign in to comment.