From 0060552aba2c84c68ed01cec555a670e001f2a51 Mon Sep 17 00:00:00 2001 From: sceox Date: Mon, 12 Jul 2021 08:03:31 -0700 Subject: [PATCH] change tabs to spaces --- ircbot.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ircbot.sh b/ircbot.sh index 68917b7..2f656d8 100755 --- a/ircbot.sh +++ b/ircbot.sh @@ -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