General Actions to handlers Refacto

This commit is contained in:
STEINNI
2026-06-20 18:50:26 +00:00
parent 7435d96135
commit 44a84c64ec
56 changed files with 832 additions and 973 deletions
+33
View File
@@ -0,0 +1,33 @@
#!/bin/sh
set -a
. /etc/p42/secrets.env
set +a
daemon=p42Maestro
logfile=maestro.log
pid=$(pgrep -f "$daemon")
if [ -z "$pid" ]
then
node "${daemon}.js" --debug > "$logfile" 2>&1 &
pid=$!
sleep 1
if kill -0 "$pid" 2>/dev/null
then
echo ""
echo "$daemon is now running with PID=$pid"
echo ""
else
echo ""
echo "Failed to start $daemon. Check maestro.log"
echo ""
fi
else
echo ""
echo "$daemon is already running with PID=$pid"
echo ""
fi