aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-04-05 14:32:30 +0300
committerkaotisk <kaotisk@arching-kaos.org>2024-04-05 14:32:30 +0300
commit0ced069a14076f148f240c38f71dd1dc41ae02a2 (patch)
treeb50f1cba6d8d2cfcf473053e8460aff4cd1d0df7
parent29b0d694517e610f98880844aeebe8eb12b0033a (diff)
downloadarching-kaos-tools-0ced069a14076f148f240c38f71dd1dc41ae02a2.tar.gz
arching-kaos-tools-0ced069a14076f148f240c38f71dd1dc41ae02a2.tar.bz2
arching-kaos-tools-0ced069a14076f148f240c38f71dd1dc41ae02a2.zip
using library instead of naked calls
-rwxr-xr-xinit.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/init.sh b/init.sh
index c4c92c0..8de34ce 100755
--- a/init.sh
+++ b/init.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+source lib/_ak_ipfs
# TODO GPG/PGP setup:: possibly done
# eg gpg2 --full-key-generate and/or gpg2 --set-default key
@@ -16,9 +17,9 @@ ak_gpg_check_or_create(){
ipfs_zarchive_check_or_mkdir(){
printf "Checking for /zarchive in IPFS FS..."
- ipfs files ls /zarchive > /dev/null 2>&1
+ _ak_ipfs files ls /zarchive > /dev/null 2>&1
if [ $? != 0 ]; then
- ipfs files mkdir /zarchive > /dev/null 2>&1
+ _ak_ipfs files mkdir /zarchive > /dev/null 2>&1
if [ $? != 0 ]; then
printf "\tError!\n"
exit 1
@@ -32,9 +33,9 @@ ipfs_zarchive_check_or_mkdir(){
ipfs_zlatest_check_or_create(){
printf "Looking for /zlatest..."
- ipfs files stat /zlatest > /dev/null 2>&1
+ _ak_ipfs files stat /zlatest > /dev/null 2>&1
if [ $? != 0 ]; then
- ipfs files cp /ipfs/$(cat $AK_ZGENESIS) /zlatest
+ _ak_ipfs files cp /ipfs/$(cat $AK_ZGENESIS) /zlatest
if [ $? != 0 ]; then
printf "\tProblem copying %s to /zlatest!\n" "$AK_ZGENESIS"
exit 1
@@ -53,7 +54,7 @@ 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
- ipfs key list | grep zchain
+ _ak_ipfs key list | grep zchain
if [ "$?" -ne 0 ]
then
printf "%s" "$(ipfs key gen zchain)" > $AK_ZCHAIN