Skip to content

Instantly share code, notes, and snippets.

@renoirb
Last active December 22, 2015 16:29
Show Gist options
  • Save renoirb/6499732 to your computer and use it in GitHub Desktop.
Save renoirb/6499732 to your computer and use it in GitHub Desktop.
Get notification when something happens on a IRC channel

This should guide you to install a notifier when a hot word is issued while you are away.

Procedure overview

  1. Get a compiled version of ZNC
  2. Grab this external module (note: this is the one I am using)
  3. Configure as the documentation explains
  4. Create a shell script, see znc_notify.sh
  • Make executable sudo chmod +x /etc/znc_notify.sh

Testing

Write to a channel one of your hotwords

Leave the channel from znc, connect directly to a channel your bouncer is in.

Write in it mentionning your hotword.

As I did on a watched channel:

Hey everybody, please do not mind me poking renoirb  thanks :)

Should recieve message

First lines displays our desired headers, adjust to suit your tastes.

Subject: Highlight word happened on Mon 09 Sep 2013 02:34:32 PM EDT
Sender: SENDER@WHATCHAWANT.COM
Auto-Submitted: owner-email

On IRC, we got the following:
==============================
#symfony: <renoirb_> Hey everybody, please do not mind me poking renoirb  thanks :)
==============================
#!/bin/bash
set -e
#
# Notification shell script
#
# Put in /etc/znc_notify.sh as the default cmdnotify znc module configuration
# and make executable
#
/usr/sbin/sendmail YOUR@EMA.IL <<EOF
Subject: Highlight word happened on $(date +'%c')
Sender: SENDER@WHATCHAWANT.COM
Auto-Submitted: auto-generated
On IRC, we got the following:
==============================
$@
==============================
.
EOF
exit $?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment