diff --git a/notify.md b/notify.md index 4b52e4dd..7b050117 100644 --- a/notify.md +++ b/notify.md @@ -569,7 +569,32 @@ acme.sh --set-notify --notify-hook callmebotWhatsApp The `CALLMEBOT_YOUR_PHONE_NO` and `CALLMEBOT_API_KEY` will be saved in ~/.acme.sh/account.conf and will be reused when needed. +## 21. Set notification for customscript + +Notify via a custom shell script. The script is called with the following three parameters: +1. Subject +2. Message +3. Status code (0: success, 1: error 2: skipped) + +To set the notification hook: + +```sh +export CUSTOMSCRIPT_PATH="/usr/local/bin/acme-notification.sh" + +acme.sh --set-notify --notify-hook customscript +``` + +The CUSTOMSCRIPT_PATH will be saved in ~/.acme.sh/account.conf and will be reused when needed. +Template for a custom script: +```sh +#!/usr/bin/env sh +subject="$1" +message="$2" +status="$3" + +do-something "$subject ($status): $message" +``` \ No newline at end of file