summaryrefslogtreecommitdiffstats
path: root/bin/ircsink
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ircsink')
-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"