Implement simple status information

This commit is contained in:
Salt 2020-08-08 03:16:59 -05:00
parent b30363cc54
commit c7814a9cd9

View File

@ -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
;;
*)