diff options
-rwxr-xr-x | bin/enter (renamed from enter) | 0 | ||||
-rwxr-xr-x | bin/get-latest | 2 | ||||
-rwxr-xr-x | bin/ipfs-starter (renamed from ipfs-starter) | 0 | ||||
-rwxr-xr-x | bin/json2bash (renamed from json2bash) | 0 | ||||
-rwxr-xr-x | bin/news (renamed from news) | 0 | ||||
-rwxr-xr-x | bin/pack_z_block (renamed from pack_z_block) | 0 | ||||
-rwxr-xr-x | bin/zchain-reset | 27 | ||||
-rwxr-xr-x | getlatest.sh | 2 | ||||
-rwxr-xr-x | init.sh | 10 |
9 files changed, 36 insertions, 5 deletions
diff --git a/bin/get-latest b/bin/get-latest new file mode 100755 index 0000000..9138c1a --- /dev/null +++ b/bin/get-latest @@ -0,0 +1,2 @@ +#!/bin/bash +ipfs files stat /zlatest | head -n 1 diff --git a/ipfs-starter b/bin/ipfs-starter index 5cab1c3..5cab1c3 100755 --- a/ipfs-starter +++ b/bin/ipfs-starter diff --git a/json2bash b/bin/json2bash index 347ca93..347ca93 100755 --- a/json2bash +++ b/bin/json2bash diff --git a/pack_z_block b/bin/pack_z_block index da5e22b..da5e22b 100755 --- a/pack_z_block +++ b/bin/pack_z_block diff --git a/bin/zchain-reset b/bin/zchain-reset new file mode 100755 index 0000000..2a289c0 --- /dev/null +++ b/bin/zchain-reset @@ -0,0 +1,27 @@ +#!/bin/bash +title(){ + echo "Zchain reset" + echo "------------" +} +usage(){ + echo "Usage: $0 reset" + exit 0 +} +reset (){ + cp $ZGENESIS $ZLATEST + ipfs name publish --key=zchain /ipfs/$ZLATEST + ipfs files mkdir /zarchive + ipfs files cp /zlatest /zarchive/$(date -u +%s)-$(ipfs files stat /zlatest | head -n 1) + ipfs files rm /zlatest + ipfs files cp /ipfs/$(cat $ZLATEST) /zlatest + echo "Probably reset" + exit 0 +} +if [ ! -z $1 ]; then + case $1 in + reset) reset; exit;; + * ) usage;; + esac +else usage +fi + diff --git a/getlatest.sh b/getlatest.sh deleted file mode 100755 index f28ffbe..0000000 --- a/getlatest.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -ipfs files stat /ZLATEST | head -n 1 @@ -36,6 +36,10 @@ fi # TODO The thing is done, we are sitting on a genesis. # We also have an IPNS name to use. -if [[ ! -f $BINDIR/json2bash ]] ; then cp json2bash $BINDIR ;fi -if [[ ! -f $BINDIR/ipfs-starter ]] ; then cp ipfs-starter $BINDIR ;fi -if [[ ! -f $BINDIR/pack_z_block ]] ; then cp pack_z_block $BINDIR ;fi +# Find scripts and create symlinks + +binfiles=$(ls -1 $(pwd)/bin) +for b in $binfiles +do + if [[ ! -L $BINDIR/$b ]] ; then ln -s $(pwd)/bin/$b $BINDIR/$b ;fi +done |