summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2021-10-23 15:29:26 +0200
committertv <tv@krebsco.de>2021-10-23 15:57:06 +0200
commit72fbd0ac7ad68d2779897c1af7da98010923fa98 (patch)
tree7499212c72356f27ea4875491590377e5c083f9f
parent874ea21685828f2c993b442d7a64087daa8fb290 (diff)
ircsink: don't require PING before MODE1.0.1
-rwxr-xr-xbin/ircsink9
1 files changed, 6 insertions, 3 deletions
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"