cfk
Version:
Finbox's PaaS
21 lines (17 loc) • 492 B
Plain Text
description "send slack notification on system shutdown"
start on runlevel [056]
task
script
eval $(cfk-env)
curl -X POST -H 'Content-type: application/json' \
--data "{ \
\"attachments\": [{ \
\"text\": \":skull: $HOSTNAME is shutting down\", \
\"fallback\": \":skull: $HOSTNAME is shutting down\", \
\"color\": \"danger\",
\"author_name\": \"$DOMAIN\"
}], \
\"channel\": \"#$SLACK_CHANNEL\" \
}" \
$SLACK_HOOK
end script