From 72fbd0ac7ad68d2779897c1af7da98010923fa98 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 23 Oct 2021 15:29:26 +0200 Subject: ircsink: don't require PING before MODE --- bin/ircsink | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'bin/ircsink') diff --git a/bin/ircsink b/bin/ircsink index a86c183..fafa4a7 100755 --- a/bin/ircsink +++ b/bin/ircsink @@ -146,10 +146,13 @@ main() {( echo2 "USER $LOGNAME 0 * :$LOGNAME@$(hostname)" echo2 "NICK $nick" - awk 'match($0, /PING(.*)/, m) {print "PONG", m[1]; exit}' + sed -nru ' + # wait for MODE message + /^:[^ ]* MODE /q - # wait for MODE message - sed -n '/^:[^ ]* MODE /q' + # answer any PING messages while waiting + s/^PING (:.*)/PONG \1/p + ' if is_channel "$target"; then echo2 "JOIN $target" -- cgit v1.2.3