shithub: x

ref: 70cc21bcb5179d02b5f4d2adf3e5d3b6ce1d0830
dir: /mnt/

View raw version
#!/bin/rc

rfork e

fn usage {
	echo usage: x/mnt [[user@]host] >[1=2]
	exit usage
}

users=(root $user)
host=$1
if(~ $host '')
	host=`{x/path -l}
if(~ $host '')
	usage
if(~ $host *@*){
	x=`'@'{echo -n $host}
	users=$x(1)
	host=$x(2)
}
for(u in $users){
	userhost=$u@$host
	if(! test -e /srv/$userhost)
		sshfs -M -r / -s $userhost $userhost
	mount -c /srv/$userhost /x/$userhost
}