marvvin

IRC bot
Log | Files | Refs | README | LICENSE

commit e5ad5ca0e7c75f2ce79dd3ab95013216897e2c42
parent 1d951ff556fe970376f767571980dc772e36d16c
Author: hhvn <dev@hhvn.uk>
Date:   Fri, 23 Apr 2021 10:55:34 +0100

main.sh functions.sh: move checking for 'stop'

Diffstat:
Mfunctions.sh | 8++++++++
Mmain.sh | 6++----
2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/functions.sh b/functions.sh @@ -17,6 +17,14 @@ _mkfifo(){ mkfifo $input } +# _checkstop(void) +_checkstop(){ + [ -f stop ] && { + rm stop + kill -1 $$ + } +} + # connect(host, port) [ "$tls" = "y" ] && { connect(){ diff --git a/main.sh b/main.sh @@ -22,10 +22,6 @@ export nick server port input inlog outlog comment tmpdir while _mkfifo do sleep 1 - [ -f stop ] && { - rm stop - kill -1 $$ - } ( printf '%s\r\n' "NICK $nick" @@ -40,5 +36,7 @@ do filter "$line" done >/dev/null | tee $input + _checkstop sleep 10 + _checkstop done