]> git.lizzy.rs Git - plan9front.git/commitdiff
ircrc: various improvements (thanks again pap!)
authorcinap_lenrek <cinap_lenrek@gmx.de>
Thu, 11 Oct 2012 23:05:34 +0000 (01:05 +0200)
committercinap_lenrek <cinap_lenrek@gmx.de>
Thu, 11 Oct 2012 23:05:34 +0000 (01:05 +0200)
the -t option was ineffective. this fixes is.

fix incompatibility with 9vx as its tcp/status
file returns slightly different format than
Plan 9.

strip annoying \ 2 character from nickserv.

rc/bin/ircrc

index 4e18a37c3f1648ca7b4087d54c4f20673f7ffb16..e54d2a000b6a647b45dad1598a68fc38c4542da8 100755 (executable)
@@ -34,6 +34,10 @@ fn work {
        echo NICK $nick > $netdir/data
        if (~ $#pass 1)
                echo PRIVMSG 'nickserv :'identify $"pass > $netdir/data
+       if(~ $#target 1){
+               title
+               echo JOIN $target > $netdir/data
+       }
        while (cmd=`{read}) {
        msg=()
        out=()
@@ -148,7 +152,7 @@ fn privmsg {
 }
 
 fn pretty {
-       while (~ `{cat $netdir/status} Established*) {
+       while (~ `{cat $netdir/status} *Established*) {
                line=`{read}
                switch ($line) {
                case *JOIN* *QUIT* *PART* *NICK*
@@ -231,6 +235,6 @@ if(~ $#userpass 2 && ~ $nick $user) {
        netdir=`{basename -d $clonefile} ^ / ^  `{cat /fd/4}
        echo connect $ip!$port >$netdir/ctl || exit 'cannot connect'
        echo connected to tcp!$ip!$port on $netdir
-       cat $netdir/data | tr -d '\r' | pretty & 
+       cat $netdir/data | tr -d '\r\ 2' | pretty & 
        work
 }