Compare commits

...

2 Commits

Author SHA1 Message Date
sceox
0060552aba change tabs to spaces 2021-07-12 08:03:31 -07:00
sceox
88a3881894 fix typo 2021-07-09 23:31:24 -07:00
2 changed files with 12 additions and 10 deletions

View File

@ -8,14 +8,14 @@ SYSTEMD_UNIT_DIR = /lib/systemd/system
rc: install
@echo installing ircbot to /etc/rc.d
@cf -f services/rc/ircbot /etc/rc.d
@cp -f services/rc/ircbot /etc/rc.d
@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}
@cf -f services/systemd/ircbot.service ${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

View File

@ -3,6 +3,8 @@
# TODO: make sure only nagios can write to $inputf and $msgf, else do not run
# configuration area
# TODO: separate configuration into a file owned by nagios user.
# this improves security and allows reinstall (from git) to not clobber config.
nick='nagios'
chan='#ops'
server='irc.anarchyplanet.org'
@ -17,14 +19,14 @@ joinmsg="nagios bot reporting"
touch $msgf
connect() {
echo "NICK $nick" > $inputf
echo "USER $nick 8 * : $nick" >> $inputf
echo "PRIVMSG NickServ : identify $password" >> $inputf
echo "JOIN $chan" >> $inputf
echo "PRIVMSG $chan : $joinmsg" >> $inputf
echo "NICK $nick" > $inputf
echo "USER $nick 8 * : $nick" >> $inputf
echo "PRIVMSG NickServ : identify $password" >> $inputf
echo "JOIN $chan" >> $inputf
echo "PRIVMSG $chan : $joinmsg" >> $inputf
}
reconnect() {
exec $0
exec $0
}
delay() {
while read line
@ -61,7 +63,7 @@ do
;;
*'Cannot join'*) sleep 10; echo "JOIN $chan" >> $inputf
;;
*'ERROR :Closing link:'*) reconnect
;;
*'ERROR :Closing link:'*) reconnect
;;
esac
done