shithub: riscv

Download patch

ref: 3be526d4b93c750ff7751d50cf5fb5d34f9d8de5
parent: 069230cd621ae5b3b9ab6e1a31eb6250fc86e30b
parent: 17291d91bb3063fe8ba0bb5b73c329d317fa7108
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Jan 7 00:20:13 EST 2018

merge

--- a/rc/bin/rconnect
+++ b/rc/bin/rconnect
@@ -2,8 +2,9 @@
 rfork e
 
 argv0=$0
+aanto=86400 #one day
 fn usage {
-	echo 'usage:' $argv0 '[-u user] [-k keypattern] [-p] host remotescript localcommand arg ...' >[1=2]
+	echo 'usage:' $argv0 '[-u user] [-k keypattern] [-p] [-t timeout] host remotescript localcommand arg ...' >[1=2]
 	exit 'usage'
 }
 
@@ -24,6 +25,7 @@
 		switch($1){
 		case -k; keyspec=($keyspec $2)
 		case -u; keyspec=($keyspec `{user=$2 pvar user})
+		case -t; aanto=$2
 		case *; usage
 		}
 		shift
@@ -53,7 +55,7 @@
 				echo -n 'announce *!0' >[1=3]
 				echo `{cat $netdir/local} || exit
 				bind '#|' /mnt/aan || exit
-				exec aan $netdir <>/mnt/aan/data1 >[1=0] >[2]/dev/null &
+				exec aan -m $aanto $netdir <>/mnt/aan/data1 >[1=0] >[2]/dev/null &
 			}
 		}
 		<>/mnt/aan/data >[1=0] >[2]/dev/null {
@@ -60,7 +62,7 @@
 			rfork n
 			fn server {
 				echo -n aanserver $netdir >/proc/$pid/args
-				rm -f /env/^('fn#server' 'fn#aanserver')
+				rm -f /env/^('fn#server' 'fn#aanserver' 'aanto')
 				. <{n=`{read} && ! ~ $#n 0 && read -c $n} >[2=1]
 			}
 			exec tlssrv -A /bin/rc -c server
@@ -69,9 +71,9 @@
 	}
 	fn aanclient {
 		host=`{echo $host | sed 's/(.*)!([^!]+)$/\1/'}^!^`{read | sed 's/(.*)!([^!]+)$/\2/'} || exit
-		tlsclient -a -o <>{rfork s; aan -c $host >[1=0]} /bin/rc -c 'sendscript $*' $*
+		tlsclient -a -o <>{rfork s; aan -m $aanto -c $host >[1=0]} /bin/rc -c 'sendscript $*' $*
 	}
-	exec $argv0 -k $"keyspec $host <{builtin whatis aanserver; echo aanserver} aanclient $*
+	exec $argv0 -k $"keyspec $host <{builtin whatis aanserver; pvar aanto; echo aanserver} aanclient $*
 	exit
 }
 
--- a/rc/bin/rcpu
+++ b/rc/bin/rcpu
@@ -3,7 +3,7 @@
 
 argv0=$0
 fn usage {
-	echo 'usage:' $argv0 '[-u user] [-k keypattern] [-P patternfile] [-p] [-h host] [-c cmd arg ...]' >[1=2]
+	echo 'usage:' $argv0 '[-u user] [-k keypattern] [-P patternfile] [-p] [-t timeout] [-h host] [-c cmd arg ...]' >[1=2]
 	exit 'usage'
 }
 
@@ -63,7 +63,7 @@
 		~ $#* 1 && usage
 		switch($1){
 		case -P; exportfs=($exportfs $1 $2)
-		case -[uk]; connect=($connect $1 $2)
+		case -[ukt]; connect=($connect $1 $2)
 		case -h; host=$2
 		case -c; cmd=$*(2-); *=()
 		case *; usage
--- a/rc/bin/rexport
+++ b/rc/bin/rexport
@@ -3,7 +3,7 @@
 
 argv0=$0
 fn usage {
-	echo 'usage:' $argv0 '[-abcCnq] [-s remotename] [-m remotemtpt] [-u user] [-k keypattern] [-P patternfile] [-p] tree host [remotecmd [args ...]]' >[1=2]
+	echo 'usage:' $argv0 '[-abcCnq] [-s remotename] [-m remotemtpt] [-u user] [-k keypattern] [-P patternfile] [-p] [-t timeout] tree host [remotecmd [args ...]]' >[1=2]
 	exit 'usage'
 }
 
@@ -30,7 +30,7 @@
 		~ $#* 1 && usage
 		switch($1){
 		case -P; exportfs=($exportfs $1 $2)
-		case -[uk]; connect=($connect $1 $2)
+		case -[ukt]; connect=($connect $1 $2)
 		case -s; sname=`{basename $2}
 		case -m; mtpt=$2
 		case *; usage
--- a/rc/bin/rimport
+++ b/rc/bin/rimport
@@ -3,7 +3,7 @@
 
 argv0=$0
 fn usage {
-	echo 'usage:' $argv0 '[-abcCnq] [-s name] [-u user] [-k keypattern] [-p] host tree [mountpoint]' >[1=2]
+	echo 'usage:' $argv0 '[-abcCnq] [-s name] [-u user] [-k keypattern] [-p] [-t timeout] host tree [mountpoint]' >[1=2]
 	exit 'usage'
 }
 
@@ -29,7 +29,7 @@
 	case *
 		~ $#* 1 && usage
 		switch($1){
-		case -[uk]; connect=($connect $1 $2)
+		case -[ukt]; connect=($connect $1 $2)
 		case -s; sname=`{basename $2}
 		case *; usage
 		}