diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-06-30 07:01:15 +0300 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-06-30 07:01:15 +0300 |
commit | 30a2bc6cc950bcd460e5a3651ab869a732a0f50b (patch) | |
tree | ff9abace41c2d356301f0fcd72211ee974c7efb9 /init.sh | |
parent | 35ddac1871fbbc608417e1b1ec2012bf09687edd (diff) | |
download | arching-kaos-tools-30a2bc6cc950bcd460e5a3651ab869a732a0f50b.tar.gz arching-kaos-tools-30a2bc6cc950bcd460e5a3651ab869a732a0f50b.tar.bz2 arching-kaos-tools-30a2bc6cc950bcd460e5a3651ab869a732a0f50b.zip |
Refactoring
Diffstat (limited to 'init.sh')
-rwxr-xr-x | init.sh | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -8,7 +8,7 @@ source lib/_ak_ipfs # existing one if any. ak_gpg_check_or_create(){ gpg2 --homedir $AK_GPGHOME --list-keys | grep kaos@kaos.kaos -B 1 - if [ "$?" -ne "0" ] + 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 -B 1 | head -n 1 | awk '{print $1}')" @@ -19,9 +19,9 @@ ak_gpg_check_or_create(){ ipfs_zarchive_check_or_mkdir(){ printf "Checking for /zarchive in IPFS FS..." _ak_ipfs files ls /zarchive > /dev/null 2>&1 - if [ $? != 0 ]; then + if [ $? -ne 0 ]; then _ak_ipfs files mkdir /zarchive > /dev/null 2>&1 - if [ $? != 0 ]; then + if [ $? -ne 0 ]; then printf "\tError!\n" exit 1 else @@ -35,9 +35,9 @@ ipfs_zarchive_check_or_mkdir(){ ipfs_zlatest_check_or_create(){ printf "Looking for /zlatest..." _ak_ipfs files stat /zlatest > /dev/null 2>&1 - if [ $? != 0 ]; then + if [ $? -ne 0 ]; then _ak_ipfs files cp /ipfs/$(cat $AK_ZGENESIS) /zlatest - if [ $? != 0 ]; then + if [ $? -ne 0 ]; then printf "\tProblem copying %s to /zlatest!\n" "$AK_ZGENESIS" exit 1 else @@ -56,7 +56,7 @@ if [ -f $AK_ZGENESIS ] ; then printf "%s" "$(_ak_ipfs add -q $AK_GENESIS)" > $AK if [ ! -f $AK_ZCHAIN ] then _ak_ipfs key list | grep zchain - if [ "$?" -ne 0 ] + if [ $? -ne 0 ] then printf "%s" "$(_ak_ipfs key gen zchain)" > $AK_ZCHAIN else |