aboutsummaryrefslogtreecommitdiff
path: root/init.sh
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-06-07 01:41:33 +0300
committerkaotisk <kaotisk@arching-kaos.org>2024-06-07 01:41:33 +0300
commit19cb280a2cc8da730b2e6797aede1b36253e6714 (patch)
tree9ae72bba54856d99a00cead27455556906c6e641 /init.sh
parentab9b088ad0c097f803bd489a68a7f45db9af8570 (diff)
downloadarching-kaos-tools-19cb280a2cc8da730b2e6797aede1b36253e6714.tar.gz
arching-kaos-tools-19cb280a2cc8da730b2e6797aede1b36253e6714.tar.bz2
arching-kaos-tools-19cb280a2cc8da730b2e6797aede1b36253e6714.zip
Fixes and updates in tests
Diffstat (limited to 'init.sh')
-rwxr-xr-xinit.sh17
1 files changed, 9 insertions, 8 deletions
diff --git a/init.sh b/init.sh
index 30532f9..43f2a40 100755
--- a/init.sh
+++ b/init.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+set -x
source lib/_ak_ipfs
# TODO GPG/PGP setup:: possibly done
@@ -6,11 +7,11 @@ source lib/_ak_ipfs
# or just question the user if they are going to use their
# existing one if any.
ak_gpg_check_or_create(){
- gpg2 --homedir $AK_GPGHOME --list-keys | grep kaos@kaos.kaos -1
+ gpg2 --homedir $AK_GPGHOME --list-keys | grep kaos@kaos.kaos -B 1
if [ "$?" -ne "0" ]
then
gpg2 --homedir $AK_GPGHOME --batch --passphrase '' --quick-gen-key kaos@kaos.kaos rsa3072 sign 0
- AK_FINGERPRINT="$(gpg2 --homedir $AK_GPGHOME --list-keys | grep kaos@kaos.kaos -1 | head -n 1 | awk '{print $1}')"
+ AK_FINGERPRINT="$(gpg2 --homedir $AK_GPGHOME --list-keys | grep kaos@kaos.kaos -B 1 | head -n 1 | awk '{print $1}')"
gpg2 --homedir $AK_GPGHOME --batch --passphrase '' --quick-add-key $AK_FINGERPRINT rsa3072 encrypt 0
fi
}
@@ -51,22 +52,22 @@ printf "Initialization started... \n"
ak_gpg_check_or_create
-if [ -f $AK_ZGENESIS ] ; then printf "%s" "$(ipfs add -q $AK_GENESIS)" > $AK_ZGENESIS;fi
+if [ -f $AK_ZGENESIS ] ; then printf "%s" "$(_ak_ipfs add -q $AK_GENESIS)" > $AK_ZGENESIS;fi
if [ ! -f $AK_ZCHAIN ]
then
_ak_ipfs key list | grep zchain
if [ "$?" -ne 0 ]
then
- printf "%s" "$(ipfs key gen zchain)" > $AK_ZCHAIN
+ printf "%s" "$(_ak_ipfs key gen zchain)" > $AK_ZCHAIN
else
- printf "%s" "$(ipfs key list -l | grep zchain | awk '{ print $1 }')" > $AK_ZCHAIN
+ printf "%s" "$(_ak_ipfs key list -l | grep zchain | awk '{ print $1 }')" > $AK_ZCHAIN
fi
fi
if [ ! -f $AK_ZLATEST ] ; then cp $AK_ZGENESIS $AK_ZLATEST;fi
if [ ! -f $AK_ZCHAINASC ] ; then gpg2 --homedir $AK_GPGHOME -bao $AK_ZCHAINASC $AK_ZCHAIN;fi
-if [ ! -f $AK_ZZCHAIN ] ; then printf "%s" "$(ipfs add -q $AK_ZCHAINASC)" > $AK_ZZCHAIN;fi
+if [ ! -f $AK_ZZCHAIN ] ; then printf "%s" "$(_ak_ipfs add -q $AK_ZCHAINASC)" > $AK_ZZCHAIN;fi
if [ ! -f $AK_GENESISASC ] ; then gpg2 --homedir $AK_GPGHOME -bao $AK_GENESISASC $AK_GENESIS;fi
-if [ ! -f $AK_ZGENESISASC ] ; then printf "%s" "$(ipfs add -q $AK_GENESISASC)" > $AK_ZGENESISASC;fi
+if [ ! -f $AK_ZGENESISASC ] ; then printf "%s" "$(_ak_ipfs add -q $AK_GENESISASC)" > $AK_ZGENESISASC;fi
if [ ! -f $AK_ZBLOCKSFILE ] ; then printf "[]" > $AK_ZBLOCKSFILE;fi
if [ ! -f $AK_ZPAIRSFILE ] ; then printf "[]" > $AK_ZPAIRSFILE;fi
if [ ! -f $AK_ZPEERSFILE ] ; then printf "[]" > $AK_ZPEERSFILE;fi
@@ -119,7 +120,7 @@ do
printf "\tOK!\n"
fi
done
-#
+
# Find modules and create symlinks
modfiles=$(ls -1 $(pwd)/modules)
for m in $modfiles