on-start script updated, localized scripts added

on-start script updated, localized scripts added
This commit is contained in:
Alexander I. Chebykin 2022-10-29 21:15:02 +03:00
parent fafcdfa9c7
commit 85654f51a0
5 changed files with 24 additions and 3 deletions

View File

@ -127,7 +127,7 @@ Next you need to find your Telegram Chat ID.
### Service configuration (*nix)
If you want to get messages when watchdog service is stopped, uncomment following line: ```ExecStopPost=send-telegram 'ATTENTION! Watchdog is stopped!'``` or ```#ExecStopPost=/usr/local/sbin/cai-watchdog-stopped``` if you want message with exclamation icon (⚠)
If you want to get messages when watchdog service is stopped, uncomment following line: ```ExecStopPost=/etc/cai-watchdog/on-stop```
## User logins monitoring (*nix)

View File

@ -8,4 +8,4 @@ if [[ -z "$APP_PATH" ]] ; then
fi
source ${APP_PATH}/inc-icons
${APP_PATH}/send-telegram "${ICON_INFO} ATTENTION! Watchdog is stopped!"
${APP_PATH}/send-telegram "${ICON_INFO} Watchdog is started!"

View File

@ -0,0 +1,11 @@
#!/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
source ${APP_PATH}/inc-icons
${APP_PATH}/send-telegram "${ICON_INFO} Watchdog запущен!"

View File

@ -0,0 +1,11 @@
#!/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
source ${APP_PATH}/inc-icons
${APP_PATH}/send-telegram "${ICON_WARNING} ВНИМАНИЕ! Watchdog остановлен!"

View File

@ -7,7 +7,6 @@ Group=www
Type=simple
ExecStart=/usr/local/sbin/cai-watchdog
#ExecStopPost=/etc/cai-watchdog/on-stop
#ExecStopPost=send-telegram 'ATTENTION! Watchdog is stopped!'
KillMode=control-group
NotifyAccess=all