mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +00:00
Very simple directory upload tool
This commit is contained in:
parent
6baa73c24e
commit
74e8f1c3ea
1 changed files with 28 additions and 0 deletions
28
bzz/bzzup/bzzup.sh
Executable file
28
bzz/bzzup/bzzup.sh
Executable file
|
|
@ -0,0 +1,28 @@
|
||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
INDEX='index.html'
|
||||||
|
|
||||||
|
bzzroot="$1"
|
||||||
|
[ "_$1" = _ ] && bzzroot=.
|
||||||
|
|
||||||
|
delimiter='[{'
|
||||||
|
|
||||||
|
pushd "$bzzroot" > /dev/null
|
||||||
|
|
||||||
|
(for path in `find . -type f`
|
||||||
|
do
|
||||||
|
name=`echo "$path" | cut -c2-`
|
||||||
|
[ _`basename "$name"` = "_$INDEX" ] && name=`dirname "$name"`
|
||||||
|
echo -n "$delimiter"
|
||||||
|
hash=`wget -q -O- --post-file="$path" http://localhost:8500/raw`
|
||||||
|
mime=`mimetype -b "$path"`
|
||||||
|
echo -n "\"hash\":\"$hash\",\"path\":\"$name\",\"content_type\":\"$mime\""
|
||||||
|
delimiter='},{'
|
||||||
|
|
||||||
|
done
|
||||||
|
echo -n '}]') | wget -q -O- --post-data=`cat` http://localhost:8500/raw
|
||||||
|
|
||||||
|
echo
|
||||||
|
|
||||||
|
popd > /dev/null
|
||||||
|
|
||||||
Loading…
Reference in a new issue