summaryrefslogtreecommitdiffstats
path: root/irker/bin/irkerhook-debian
blob: bd9e160dc1825f08708b9c7bc3a08aac0a4e7094 (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