From c7814a9cd9cb804bac1e9b2c854dc1cbda050c5b Mon Sep 17 00:00:00 2001 From: Salt Date: Sat, 8 Aug 2020 03:16:59 -0500 Subject: [PATCH] Implement simple status information --- firestarter | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/firestarter b/firestarter index a9b9534..957b9e4 100755 --- a/firestarter +++ b/firestarter @@ -151,6 +151,26 @@ fsstatus() { if [ -z "$FIRESTARTER" ]; then error "Firestarter is not currently running" 56 fi + # Current process status + local psline + if [ -d "/proc/$FIRESTARTER" ]; then + psline="\e[32m●\e[0m Running (PID $FIRESTARTER)" + else + psline="\e[31m●\e[0m Dead (PID $FIRESTARTER)" + fi + printf "$psline\n" + # Display information + local displayline + if [ "$FIRESTARTER_DISPLAY" == "$DISPLAY" ]; then + displayline="On display: \e[32m$FIRESTARTER_DISPLAY\e[0m" + else + displayline="On display: \e[31m$FIRESTARTER_DISPLAY\e[0m (currently on $DISPLAY)" + fi + printf "\t$displayline\n" + # Configuration information + if [ -n "$FS_DIEONWM" ] && gettarget "$_optconfigdir/wm"; then + printf "\tWill die when \e[34m$_return\e[0m exits\n" + fi } step_preexecute() { # Special things that can't use simple configuration files @@ -380,7 +400,7 @@ firestart() { fsexec "$_optconfigdir"/"$file" done ;; - status) + st|stat|status) fsstatus ;; *)