diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2023-08-20 13:24:44 +0300 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2023-08-20 13:24:44 +0300 |
commit | 8240bd9106a4c3a019a70340b7709a13a9e7e8f4 (patch) | |
tree | ec0d7e5751c62b748351d4d3df45566341e85b02 | |
parent | 925b16d12bc27aba96b9d543485a20a5e25ddbac (diff) | |
download | arching-kaos-tools-8240bd9106a4c3a019a70340b7709a13a9e7e8f4.tar.gz arching-kaos-tools-8240bd9106a4c3a019a70340b7709a13a9e7e8f4.tar.bz2 arching-kaos-tools-8240bd9106a4c3a019a70340b7709a13a9e7e8f4.zip |
Check if there is already a zchain key in IPFS
-rwxr-xr-x | init.sh | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -51,7 +51,16 @@ 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_ZCHAIN ] ; then printf "%s" "$(ipfs key gen zchain)" > $AK_ZCHAIN;fi +if [ ! -f $AK_ZCHAIN ] +then + ipfs key list | grep zchain + if [ "$?" -ne 0 ] + then + printf "%s" "$(ipfs key gen zchain)" > $AK_ZCHAIN + else + printf "%s" "$(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 |