Sender for droopy
This commit is contained in:
25
droopysend
Executable file
25
droopysend
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#droopy uploader
|
||||||
|
|
||||||
|
IP=128.214.60.230
|
||||||
|
PORT=8686
|
||||||
|
|
||||||
|
function show_error() {
|
||||||
|
echo Cannot access $IP:$PORT
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for f in $@
|
||||||
|
do a=$( readlink -f "$f" )
|
||||||
|
b=$( basename "$f" )
|
||||||
|
[[ -f "$a" ]] && {
|
||||||
|
curl -X POST -F upfile=@"$f" http://$IP:$PORT/ || show_error
|
||||||
|
}
|
||||||
|
[[ -d "$a" ]] && {
|
||||||
|
curl -X POST -F upfile=@<( tar cz "$f" ) -F realname="$b".tgz http://$IP:$PORT/ || show_error
|
||||||
|
}
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user