Added status to fake daemon functions

This commit is contained in:
Geoff Murphy 2025-05-13 14:35:45 +10:00
parent 0bd708bcba
commit 0f896e2ec6

View file

@ -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 ]--------#