shithub: rc

Download patch

ref: ffa46c0251c8856b4ca47c806446ffdbd65a6e6c
parent: 8fb8d28470dec5b5ff4ed5782673efd2c01f6604
author: qwx <qwx@sciops.net>
date: Sun Apr 20 20:51:06 EDT 2025

kx: allow for different user

--- a/bin/kx
+++ b/bin/kx
@@ -1,6 +1,7 @@
 #!/bin/rc -b
 rfork ne
-wdir=/n/ssh
+wdir=/n/ssh/strpg
+usr=$user
 fn usage{
 	echo $0 >[1=2]
 	exit usage
@@ -10,6 +11,9 @@
 	case -r
 		wdir=/n/ssh/$2
 		shift
+	case -u
+		usr=$2
+		shift
 	case *
 		usage
 	}
@@ -17,8 +21,9 @@
 }
 if(! ~ $#* 1)
 	usage
+m=$1
 if(! ~ $1 tcp!*)
-	m=tcp!$1!17060
+	m=tcp!$1!x
 . /tmp/sizes.$sysname
 
 f=()
@@ -35,8 +40,8 @@
 
 cat <<! >/tmp/kx.$pid
 #!/bin/rc
-sshfs $m || exit
-cd $wdir || {echo root directory $wdir does not exist >[1=2]; exit usage}
+sshfs $usr@$m || exit
+cd $wdir || {echo root directory $wdir does not exist >[1=2]; sleep 10; exit usage}
 unmount /mnt/plumb
 plumbsrv=()
 plumber -s plumb.$pid
--