aboutsummaryrefslogtreecommitdiff
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
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
-rwxr-xr-xbin/enter (renamed from enter)0
-rwxr-xr-xbin/get-latest2
-rwxr-xr-xbin/ipfs-starter (renamed from ipfs-starter)0
-rwxr-xr-xbin/json2bash (renamed from json2bash)0
-rwxr-xr-xbin/news (renamed from news)0
-rwxr-xr-xbin/pack_z_block (renamed from pack_z_block)0
-rwxr-xr-xbin/zchain-reset27
-rwxr-xr-xgetlatest.sh2
-rwxr-xr-xinit.sh10
9 files changed, 36 insertions, 5 deletions
diff --git a/enter b/bin/enter
index 6865797..6865797 100755
--- a/enter
+++ b/bin/enter
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/news b/bin/news
index 910f1cb..910f1cb 100755
--- a/news
+++ b/bin/news
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
diff --git a/init.sh b/init.sh
index 97f04b2..1f1fa78 100755
--- a/init.sh
+++ b/init.sh
@@ -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