From 606e3bd269fdc2cf687db82c43a5346f8081864f Mon Sep 17 00:00:00 2001 From: kaotisk Date: Sat, 18 Dec 2021 08:33:02 +0200 Subject: Different approach on installing, now symlinks --- bin/zchain-reset | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 bin/zchain-reset (limited to 'bin/zchain-reset') 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 + -- cgit v1.2.3