aboutsummaryrefslogtreecommitdiff
path: root/bin/zchain-reset
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.com>2021-12-18 08:33:02 +0200
committerkaotisk <kaotisk@arching-kaos.com>2021-12-18 08:33:02 +0200
commit606e3bd269fdc2cf687db82c43a5346f8081864f (patch)
tree2f88a716af27ebeacc7ef4c33fa467cf236c4477 /bin/zchain-reset
parent6cbf9b47f966556f92565392e83b410729c8be35 (diff)
downloadarching-kaos-tools-606e3bd269fdc2cf687db82c43a5346f8081864f.tar.gz
arching-kaos-tools-606e3bd269fdc2cf687db82c43a5346f8081864f.tar.bz2
arching-kaos-tools-606e3bd269fdc2cf687db82c43a5346f8081864f.zip
Different approach on installing, now symlinks
Diffstat (limited to 'bin/zchain-reset')
-rwxr-xr-xbin/zchain-reset27
1 files changed, 27 insertions, 0 deletions
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
+