aboutsummaryrefslogtreecommitdiff
path: root/init.sh
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.com>2021-12-14 03:50:02 +0200
committerkaotisk <kaotisk@arching-kaos.com>2021-12-14 03:50:02 +0200
commit03a0fd66bd696a5cbf9cd91dde242df60e4a6f96 (patch)
treefc1100ce3736f536ab1c7a0a0927c18bd0d2ae07 /init.sh
parente93bc58da017610d6f92d68b40f908d09d529d53 (diff)
downloadarching-kaos-tools-03a0fd66bd696a5cbf9cd91dde242df60e4a6f96.tar.gz
arching-kaos-tools-03a0fd66bd696a5cbf9cd91dde242df60e4a6f96.tar.bz2
arching-kaos-tools-03a0fd66bd696a5cbf9cd91dde242df60e4a6f96.zip
As far as I 've been
Diffstat (limited to 'init.sh')
-rwxr-xr-xinit.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/init.sh b/init.sh
new file mode 100755
index 0000000..3c9912b
--- /dev/null
+++ b/init.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+#source ./config.sh
+echo "INIT started"
+#echo This is our work dir: $WORKDIR
+if [[ ! -d $WORKDIR ]] ; then mkdir $WORKDIR ;fi
+if [[ ! -d $CONFIGDIR ]] ; then mkdir $CONFIGDIR ;fi
+if [[ ! -d $BINDIR ]]; then mkdir $BINDIR ;fi
+if [[ ! -d $ARCHIVESDIR ]]; then mkdir $ARCHIVESDIR ;fi
+if [[ ! -f $GENESIS ]] ; then touch $GENESIS;fi
+if [[ ! -f $ZGENESIS ]] ; then echo "$(ipfs add -q $GENESIS)" > $ZGENESIS;fi
+if [[ ! -f $ZCHAIN ]] ; then echo "$(ipfs key gen zchain)" > $ZCHAIN;fi
+if [[ ! -f $ZLATEST ]] ; then cp $ZGENESIS $ZLATEST;fi
+if [[ ! -f $ZCHAINASC ]] ; then gpg2 -bao $ZCHAINASC $ZCHAIN;fi
+if [[ ! -f $ZZCHAIN ]] ; then echo $(ipfs add -q $ZCHAINASC) > $ZZCHAIN;fi
+if [[ ! -f $GENESISASC ]] ; then gpg2 -bao $GENESISASC $GENESIS;fi
+if [[ ! -f $ZGENESISASC ]] ; then echo $(ipfs add -q $GENESISASC) > $ZGENESISASC;fi
+ipfs files ls /zarchive > /dev/null 2>&1
+if [ $? != 0 ]; then
+ ipfs files mkdir /zarchive
+fi
+ipfs files stat /ZLATEST > /dev/null 2>&1
+if [ $? != 0 ]; then
+ ipfs files cp /ipfs/$(cat $ZGENESIS) /ZLATEST
+fi
+
+# TODO GPG/PGP setup
+# eg gpg2 --full-key-generate and/or gpg2 --set-default key
+# or just question the user if they are going to use their
+# existing one if any.
+
+
+
+# TODO The thing is done, we are sitting on a genesis.
+# We also have an IPNS name to use.
+
+