ref: ff95357ba43430a608c71d9c27996df20d58961c
dir: /mnt/
#!/bin/rc rfork e fn usage { echo usage: x/mnt [[user@]host ...] >[1=2] exit usage } fn mnt { user=(root $user) host=$1 if(~ $host *@*){ x=`'@'{echo -n $host} user=$x(1) host=$x(2) } for(u in $user){ userhost=$u@$host mount -c /srv/$userhost /x/$userhost >[2]/dev/null \ || sshfs -s $userhost -m /x/$userhost -r / $userhost } } hosts=$* if(~ $#hosts 0) hosts=`{x/path -l} if(~ $#hosts 0) usage for(h in $hosts) mnt `{x/path -l $h}