50 lines
1.8 KiB
Makefile
50 lines
1.8 KiB
Makefile
# configuration area:
|
|
|
|
PREFIX = /usr/local
|
|
NAGIOS_DIR = ${PREFIX}/nagios
|
|
NAGIOS_EXEC = ${NAGIOS_DIR}/libexec
|
|
NAGIOS_USER = _nagios
|
|
NAGIOS_GROUP = ${NAGIOS_USER}
|
|
SYSTEMD_UNIT_DIR = /lib/systemd/system
|
|
|
|
rc: install
|
|
@echo installing ircbot to /etc/rc.d
|
|
@cp -f services/rc/ircbot /etc/rc.d
|
|
@chmod 555 /etc/rc.d/ircbot
|
|
@echo enabling ircbot
|
|
@rcctl enable ircbot
|
|
@echo not starting ircbot -- configure it then run `rcctl start ircbot` as root
|
|
|
|
systemd: install
|
|
@echo installing ircbot.service to ${SYSTEMD_UNIT_DIR}
|
|
@cp -f services/systemd/ircbot.service ${SYSTEMD_UNIT_DIR}
|
|
@echo enabling ircbot.service
|
|
@systemctl enable ircbot.service
|
|
@echo not starting ircbot.service -- configure it then run `systemctl start ircbot.service` as root
|
|
|
|
install:
|
|
@echo installing service checking scripts to ${NAGIOS_EXEC}
|
|
@cp -f check_senderscore ${NAGIOS_EXEC}
|
|
@cp -f check_ircd ${NAGIOS_EXEC}
|
|
@cp -f check_onion ${NAGIOS_EXEC}
|
|
@chmod 755 ${NAGIOS_EXEC}/check_senderscore
|
|
@chmod 755 ${NAGIOS_EXEC}/check_ircd
|
|
@chmod 755 ${NAGIOS_EXEC}/check_onion
|
|
@echo installing ircbot.sh to ${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
|
|
|
|
uninstall:
|
|
@echo removing service checking scripts from ${NAGIOS_EXEC}
|
|
@rm -f ${NAGIOS_EXEC}/check_senderscore
|
|
@rm -f ${NAGIOS_EXEC}/check_ircd
|
|
@rm -f ${NAGIOS_EXEC}/check_onion
|
|
@echo removing ircbot.sh from ${PREFIX}/bin
|
|
@rm -f ${PREFIX}/bin/ircbot.sh
|
|
@echo removing ircbot.service from ${SYSTEMD_UNIT_DIR}
|
|
@systemctl disable ircbot.service
|
|
@rm -f ${SYSTEMD_UNIT_DIR}/ircbot.service
|