shithub: rc

Download patch

ref: 8b15a2b04136a915466309e919ebdf0ff7906f9e
parent: e3b57b355635d151d3b092a930afd94be19df0bd
author: qwx <qwx@sciops.net>
date: Fri Mar 25 05:14:02 EDT 2022

wircrc: nope! nope! NOPE! just do it in a wrapper

--- /dev/null
+++ b/bin/wii
@@ -1,0 +1,8 @@
+#!/bin/rc
+while(){
+	x=`{netstat -n | awk '$6 == 6697 && $4 == "Established"'}
+	if(~ $#x 0)
+		window -dx 162 -dy 64 \
+			'wircrc -T -p 6697 -c ''irc.oftc.net!#cat-v'' -n qwx irc.oftc.net'
+	sleep 300
+}
--- a/bin/wircrc
+++ b/bin/wircrc
@@ -9,8 +9,6 @@
 chans=()
 realname='<nil>'
 nick=$user
-latch=$*
-again=0
 
 while (~ $1 -*) {
 	switch ($1) {
@@ -175,7 +173,7 @@
 fn sigint {
 	shutdown
 }
-echo $0 $"latch
+
 wmk $server &
 dial tcp!$server!$port $tls irc $server &
 
@@ -215,7 +213,6 @@
 				if(~ $i $id || ~ $i $id!*)
 					wio $i HUNGUP $id
 			}
-			again=1
 		case wnew
 			wd$id=$a(3)
 			wp$id=$a(4)
@@ -316,5 +313,3 @@
 	}
 }
 shutdown
-if(~ $again 1)
-	window -dx 162 -dy 64 $0 $"latch
--- a/fn
+++ b/fn
@@ -64,8 +64,6 @@
 # shortcuts
 # connect to aijuboard
 fn aib{ echo b115200 >/dev/eiaU*.1ctl && con -r /dev/eiaU*.1 }
-# wircrc usage
-fn wii{ wircrc -T -p 6697 -c 'irc.oftc.net!#cat-v' -n qwx irc.oftc.net }
 # ircs usage
 fn ii{ ircx -t '#cat-v' }
 # quake2 crbot