summaryrefslogtreecommitdiffstats
path: root/debian/local/irkerhook-debian
blob: 1f05304dfe0a4240ed3bff8e29597cbc2c3d2c6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

set -e

_MESSAGE="${@}"

_PROGRAM="$(basename ${0})"

for _FILE in "/etc/default/${_PROGRAM}" "/etc/default/${_PROGRAM}.d"/*
do
	if [ -e "${_FILE}" ]
	then
		. "${_FILE}" || true
	fi
done

if [ "${IRK_ENABLED}" != "true" ]
then
	exit 0
fi

echo "sending IRC notification"

for IRC_CHANNEL in ${IRC_CHANNELS}
do
	irk ${IRC_CHANNEL} "${_MESSAGE}"
done