Add more debug statements

This commit is contained in:
Nick Chambers 2021-06-19 02:05:14 -05:00
parent abe9621d4b
commit dc1f1050d5
1 changed files with 20 additions and 19 deletions

39
rowbot
View File

@ -133,6 +133,17 @@ cleanup() {
trap cleanup EXIT
alarm-handler() {
ping "row your bot gently down the stream"
if [[ $keep_trying = yes ]]; then
info "trying for %s again" "$desired_nick"
nick "$desired_nick"
fi
}
trap alarm-handler ALRM
###
# reload code
###
@ -272,10 +283,14 @@ on_001() {
join "$chan"
fi
while true; do
kill -ALRM "$$"
sleep 10
done &
{
debug "timer pid is %d" "$BASHPID"
while true; do
kill -ALRM "$$"
sleep 10
done
} &
ping_pid=$!
nick=${params[0]}
@ -477,21 +492,6 @@ who() {
fi
}
###
# keepalive code
###
alarm-handler() {
ping "row your bot gently down the stream"
if [[ $keep_trying = yes ]]; then
info "trying for %s again" "$desired_nick"
nick "$desired_nick"
fi
}
trap alarm-handler ALRM
###
# app hooks
##
@ -709,6 +709,7 @@ if [[ $reload = yes ]]; then
privmsg "$RELOAD_TO" done.
else
registered=no
info "rowbot's pid is %d" "$$"
nick "$nick"
user "$ident" "$realname"
fi