Initial commit

This commit is contained in:
polyfloyd 2025-04-06 12:47:07 +02:00
commit 0a36fb9729
15 changed files with 88 additions and 0 deletions

27
siahsd_handler.sh Executable file
View file

@ -0,0 +1,27 @@
#!/bin/bash
set -eu
HOOKS_DIR=`dirname "$0"`
PROM="$1"
CODE="$2"
DESCR="$3"
SIA_CODE_STR="$4"
SIA_CODE_DESCR="$5"
# Ignore communication tests.
if [[ ! "$CODE" =~ "RP" ]]; then
irc-say "Alarm event: $CODE -- $SIA_CODE_STR: $SIA_CODE_DESCR"
fi
case "$CODE" in
C[LAFJKQS]*):
run-parts "$HOOKS_DIR/armed.d" --verbose "--arg=$1" "--arg=$2" "--arg=$3" "--arg=$4" "--arg=$5"
;;
O[AJKPQS]*):
run-parts "$HOOKS_DIR/disarmed.d" --verbose "--arg=$1" "--arg=$2" "--arg=$3" "--arg=$4" "--arg=$5"
;;
esac