finished actions => handlers refacto, small bux fix in maestro => Test maestro1 OK

This commit is contained in:
STEINNI
2026-06-20 20:10:14 +00:00
parent 44a84c64ec
commit 3066a54a4c
32 changed files with 386 additions and 33 deletions
+14 -2
View File
@@ -1,5 +1,11 @@
#!/bin/sh
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
# shellcheck source=../lib/resolveConfigPath.sh
. "$SCRIPT_DIR/../lib/resolveConfigPath.sh"
CONFIG="$(resolveConfigPath "$SCRIPT_DIR" "${1:-${CONFIG:-../config.json}}")"
set -a
. /etc/p42/secrets.env
set +a
@@ -7,11 +13,16 @@ set +a
daemon=p42Observer
logfile=observer.log
if [ ! -f "$CONFIG" ]; then
echo "Config file not found: $CONFIG" >&2
exit 1
fi
pid=$(pgrep -f "$daemon")
if [ -z "$pid" ]
then
node "${daemon}.js" --debug > "$logfile" 2>&1 &
node "${daemon}.js" --config "$CONFIG" --debug > "$logfile" 2>&1 &
pid=$!
sleep 1
@@ -19,12 +30,13 @@ then
if kill -0 "$pid" 2>/dev/null
then
echo ""
echo "$daemon is now running with PID=$pid"
echo "$daemon is now running with PID=$pid (config=$CONFIG)"
echo ""
else
echo ""
echo "Failed to start $daemon. Check observer.log"
echo ""
exit 1
fi
else
echo ""