Skip to content

Instantly share code, notes, and snippets.

@johnroyer
Created July 12, 2019 05:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnroyer/88405f29a51ee9b2b3374634f1a086bc to your computer and use it in GitHub Desktop.
Save johnroyer/88405f29a51ee9b2b3374634f1a086bc to your computer and use it in GitHub Desktop.
init change notification
#! /bin/sh
### BEGIN INIT INFO
# Provides: slackcat
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: OpenBSD Secure Shell server
### END INIT INFO
API="https://hooks.slack.com/services/xxxx/xxxx/xxxxxxxxxxxx"
case "$1" in
start)
echo "system is booting up" | /usr/local/bin/slackcat --url "$API"
;;
stop)
echo "system is shutting down" | /usr/local/bin/slackcat --url "$API"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment