diff options
author | rsc <devnull@localhost> | 2005-03-18 19:27:03 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-03-18 19:27:03 +0000 |
commit | 80f72cbedc7c0b60d2172ed83279585ad6079247 (patch) | |
tree | 0a9f067b08c93d74c90b8fbbca8e218ae5b40fab /bin/netfileput | |
parent | 3a6f92eed18aa29c7f5f2e150c0fb81adaa3a6bf (diff) | |
download | plan9port-80f72cbedc7c0b60d2172ed83279585ad6079247.tar.gz plan9port-80f72cbedc7c0b60d2172ed83279585ad6079247.tar.bz2 plan9port-80f72cbedc7c0b60d2172ed83279585ad6079247.zip |
handle 9p servers
Diffstat (limited to 'bin/netfileput')
-rwxr-xr-x | bin/netfileput | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/bin/netfileput b/bin/netfileput index 9a5a396d..baa3eb12 100755 --- a/bin/netfileput +++ b/bin/netfileput @@ -1,15 +1,27 @@ #!/usr/local/plan9/bin/rc -whatis '*' if(! ~ $#* 2){ echo 'usage: netput system path' >[1=2] exit usage } +f=putfile +ns=`{namespace} +if(u test -S $ns/$1) + f=$f^9p + t=/tmp/netget.$pid.$USER fn sigexit { rm -f $t } -cat >$t -if(! echo put $t $2 | sftp -b - $1 >/dev/null) - exit 1 +fn putfile{ + cat >$t + if(! echo put $t $2 | sftp -b - $1 >/dev/null) + exit 1 +} +fn putfile9p{ + if(! 9p write $1/$2) + exit 1 +} + +$f $1 $2 exit 0 |