Localized sending scripts added

Localized sending scripts added
This commit is contained in:
2022-10-29 20:54:23 +03:00
parent 56adae89ec
commit 4036a703c8
10 changed files with 268 additions and 5 deletions

View File

@@ -1,4 +1,12 @@
#!/bin/bash
APP_PATH=$(dirname "$0") # relative
APP_PATH=$(cd "$APP_PATH" && pwd) # absolutized and normalized
if [[ -z "$APP_PATH" ]] ; then
# error; for some reason, the path is not accessible
# to the script (e.g. permissions re-evaled after suid)
APP_PATH="/etc/cai-watchdog"
fi
SCRIPT_NAME=$0
MESSAGE_TEXT=$1
@@ -7,7 +15,7 @@ if [ "$#" -ne 1 ]; then
exit 0
fi
ARGS=$(xargs echo $(perl -anle 's/^[^:]+//g && s/:\s+//g && print' /etc/cai-watchdog/email.conf) < /dev/null)
ARGS=$(xargs echo $(perl -anle 's/^[^:]+//g && s/:\s+//g && print' ${APP_PATH}/email.conf) < /dev/null)
set -- $ARGS "$@";
GROUP_ID=$1