Compare commits
No commits in common. "5f96921697f41d6645c4a436e7495a0b9a6cc50c" and "f79da5cd1fc0f2484696b3d458321bbeae127af5" have entirely different histories.
5f96921697
...
f79da5cd1f
5
Makefile
5
Makefile
@ -3,8 +3,6 @@
|
|||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
NAGIOS_DIR = ${PREFIX}/nagios
|
NAGIOS_DIR = ${PREFIX}/nagios
|
||||||
NAGIOS_EXEC = ${NAGIOS_DIR}/libexec
|
NAGIOS_EXEC = ${NAGIOS_DIR}/libexec
|
||||||
NAGIOS_USER = _nagios
|
|
||||||
NAGIOS_GROUP = ${NAGIOS_USER}
|
|
||||||
SYSTEMD_UNIT_DIR = /lib/systemd/system
|
SYSTEMD_UNIT_DIR = /lib/systemd/system
|
||||||
|
|
||||||
rc: install
|
rc: install
|
||||||
@ -31,9 +29,6 @@ install:
|
|||||||
@chmod 755 ${NAGIOS_EXEC}/check_onion
|
@chmod 755 ${NAGIOS_EXEC}/check_onion
|
||||||
@echo installing ircbot.sh to ${PREFIX}/bin
|
@echo installing ircbot.sh to ${PREFIX}/bin
|
||||||
@cp -f ircbot.sh ${PREFIX}/bin
|
@cp -f ircbot.sh ${PREFIX}/bin
|
||||||
@echo installing ircbot.conf to /etc
|
|
||||||
test -f /etc/ircbot.conf || install -m 640 -o root -g ${NAGIOS_GROUP} ircbot.conf.default /etc/ircbot.conf
|
|
||||||
test -f /var/log/ircbot.log || install -m 640 -o ${NAGIOS_USER} -g wheel /dev/null /var/log/ircbot.log
|
|
||||||
@chmod 755 ${PREFIX}/bin/ircbot.sh
|
@chmod 755 ${PREFIX}/bin/ircbot.sh
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
nick='nagios'
|
|
||||||
chan='#ops'
|
|
||||||
server='irc.example.org'
|
|
||||||
email='nagios@example.org'
|
|
||||||
password='mysecretpass'
|
|
||||||
port='6667'
|
|
||||||
inputf=/tmp/ircinput
|
|
||||||
msgf=/tmp/ircmsg
|
|
||||||
logf=/var/log/ircbot.log
|
|
||||||
joinmsg="nagios bot reporting"
|
|
21
ircbot.sh
21
ircbot.sh
@ -2,14 +2,19 @@
|
|||||||
|
|
||||||
# TODO: make sure only nagios can write to $inputf and $msgf, else do not run
|
# TODO: make sure only nagios can write to $inputf and $msgf, else do not run
|
||||||
|
|
||||||
conf=/etc/ircbot.conf
|
# configuration area
|
||||||
|
# TODO: separate configuration into a file owned by nagios user.
|
||||||
if ! test -r $conf; then
|
# this improves security and allows reinstall (from git) to not clobber config.
|
||||||
echo "cannot read configuration file, exiting"
|
nick='nagios'
|
||||||
exit 1
|
chan='#ops'
|
||||||
else
|
server='irc.anarchyplanet.org'
|
||||||
. $conf
|
email='nagios@anarchyplanet.org'
|
||||||
fi
|
password='mysecretpass'
|
||||||
|
port='6667'
|
||||||
|
inputf=/tmp/ircinput
|
||||||
|
msgf=/tmp/ircmsg
|
||||||
|
logf=/tmp/notify_irc.log
|
||||||
|
joinmsg="nagios bot reporting"
|
||||||
|
|
||||||
touch $msgf
|
touch $msgf
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user