From 0f896e2ec60223f34ae62f0d88e69b5c9b9b3e78 Mon Sep 17 00:00:00 2001 From: Geoff Murphy Date: Tue, 13 May 2025 14:35:45 +1000 Subject: [PATCH] :sparkles: Added status to fake daemon functions --- src/fake_manager.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/fake_manager.sh b/src/fake_manager.sh index be83e39..c17f96a 100644 --- a/src/fake_manager.sh +++ b/src/fake_manager.sh @@ -153,6 +153,15 @@ _fake_restart () { #------[ Restart Daemon ] done echo "" } +_fake_status () { #------[ Status of Daemon ] + echo "" + echo "[STATUS] $@" + for SERVICE in $@; do + if [ "$(command -v systemctl)" ]; then systemctl status "$SERVICE" 2>> $FAKE_LOG; fi + if [ "$(command -v rc-update)" ]; then rc-service "$SERVICE" status 2>> $FAKE_LOG; fi + done + echo "" +} _fake_enable () { #-------[ Enable Daemon at Startup ] echo "" echo "[ENABLE] $@" @@ -204,6 +213,7 @@ _fake_help () { echo " start Start system daemons" echo " stop Stop system daemons" echo " restart Restart system daemons" + echo " status Show status of daemons" echo " enable Add system daemons to default startup PID" echo " disable Remove system daemons from default startup PID" echo " flush Clear system caches" @@ -227,6 +237,7 @@ elif [ "$1" == "search" ]; then _fake_search "$VARS" elif [ "$1" == "start" ]; then _fake_start "$VARS" elif [ "$1" == "stop" ]; then _fake_stop "$VARS" elif [ "$1" == "restart" ]; then _fake_restart "$VARS" +elif [ "$1" == "status" ]; then _fake_restart "$VARS" elif [ "$1" == "enable" ]; then _fake_enable "$VARS" elif [ "$1" == "disable" ]; then _fake_disable "$VARS" #--------[ Other Commands ]--------#