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 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 # reload code
### ###
@ -272,10 +283,14 @@ on_001() {
join "$chan" join "$chan"
fi fi
while true; do {
kill -ALRM "$$" debug "timer pid is %d" "$BASHPID"
sleep 10
done & while true; do
kill -ALRM "$$"
sleep 10
done
} &
ping_pid=$! ping_pid=$!
nick=${params[0]} nick=${params[0]}
@ -477,21 +492,6 @@ who() {
fi 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 # app hooks
## ##
@ -709,6 +709,7 @@ if [[ $reload = yes ]]; then
privmsg "$RELOAD_TO" done. privmsg "$RELOAD_TO" done.
else else
registered=no registered=no
info "rowbot's pid is %d" "$$"
nick "$nick" nick "$nick"
user "$ident" "$realname" user "$ident" "$realname"
fi fi