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
Executable
+38
View File
@@ -0,0 +1,38 @@
#!/bin/bash
GOD_FOLDERS="Maestro GPS Observer"
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
failed=0
read -ra folders <<< "$GOD_FOLDERS"
for((i=${#folders[@]}-1; i>=0; i--)); do
folder="${folders[i]}"
dir="$ROOT/$folder"
if [ ! -d "$dir" ]; then
echo "Missing daemon folder: $dir" >&2
failed=1
continue
fi
shopt -s nullglob
scripts=("$dir"/stop*.sh)
shopt -u nullglob
if [ ${#scripts[@]} -eq 0 ]; then
echo "No stop script in $dir" >&2
failed=1
continue
fi
if [ ${#scripts[@]} -gt 1 ]; then
echo "Multiple stop scripts in $dir, using ${scripts[0]}" >&2
fi
echo "=== Stopping $folder ==="
(cd "$dir" && bash "${scripts[0]}") || {
echo "Failed to stop $folder" >&2
failed=1
}
done
exit $failed