diff options
author | rsc <devnull@localhost> | 2005-03-18 19:30:22 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-03-18 19:30:22 +0000 |
commit | 7c709434eccd461a3f3c522df6224adf4e50a8da (patch) | |
tree | 07824349dbc0e919ab411b254cca583e5f6feb7d /src/cmd/netfiles/netfileput | |
parent | 72fd2f881907db5e367ffee1fcecb737c44a0090 (diff) | |
download | plan9port-7c709434eccd461a3f3c522df6224adf4e50a8da.tar.gz plan9port-7c709434eccd461a3f3c522df6224adf4e50a8da.tar.bz2 plan9port-7c709434eccd461a3f3c522df6224adf4e50a8da.zip |
new files
Diffstat (limited to 'src/cmd/netfiles/netfileput')
-rwxr-xr-x | src/cmd/netfiles/netfileput | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/cmd/netfiles/netfileput b/src/cmd/netfiles/netfileput new file mode 100755 index 00000000..baa3eb12 --- /dev/null +++ b/src/cmd/netfiles/netfileput @@ -0,0 +1,27 @@ +#!/usr/local/plan9/bin/rc + +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 } + +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 |