diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2023-04-03 00:24:49 +0300 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2023-04-03 00:24:49 +0300 |
commit | 9606644a0beb4f2883e1e0f4c6c81b42ab40b3a1 (patch) | |
tree | 5f16ff3c7506b653862e0171d71163074f67c96e /bin/ak-data-expand | |
parent | fe1fb88889b2c3949383c254f3058da24ba5e3f2 (diff) | |
download | arching-kaos-tools-9606644a0beb4f2883e1e0f4c6c81b42ab40b3a1.tar.gz arching-kaos-tools-9606644a0beb4f2883e1e0f4c6c81b42ab40b3a1.tar.bz2 arching-kaos-tools-9606644a0beb4f2883e1e0f4c6c81b42ab40b3a1.zip |
Renaming to prefix convention, introduced ipfs wrappers so it can be easier to maintain, changes in filesplitter and filejoiner as they move sm submodule namespace... like there are namespaces in bash or something
Diffstat (limited to 'bin/ak-data-expand')
-rwxr-xr-x | bin/ak-data-expand | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/bin/ak-data-expand b/bin/ak-data-expand index 35f7826..08aae20 100755 --- a/bin/ak-data-expand +++ b/bin/ak-data-expand @@ -11,37 +11,37 @@ then logit "[ERROR]" "Invalid hash format for $1" exit 1 fi - ipfs --timeout=10s cat $1 > /dev/null + ak-ipfs-cat $1 > /dev/null if [ "$?" -ne 0 ] then logit "[ERROR]" "Error while reading $1" exit 1 fi - ipfs --timeout=10s cat $1 | jq -M > /dev/null + ak-ipfs-cat $1 | jq -M > /dev/null if [ "$?" -ne 0 ] then logit "[ERROR]" "Error while parsing JSON for $1" exit 1 fi - ipfs --timeout=10s cat $1 | jq | grep ipfs > /dev/null + ak-ipfs-cat $1 | jq | grep ipfs > /dev/null if [ "$?" -ne 0 ] then logit "[ERROR]" "Error while extracting data from JSON for $1" exit 1 fi - DATA="$(ipfs --timeout=10s cat $1 | jq | grep ipfs | sed -e 's/"ipfs": "//g; s/[",]//g; s/ //g')" + DATA="$(ak-ipfs-cat $1 | jq | grep ipfs | sed -e 's/"ipfs": "//g; s/[",]//g; s/ //g')" if [ "$?" -ne 0 ] then logit "[ERROR]" "Error while extracting data from JSON for $1" exit 1 fi - ipfs --timeout=10s cat $1 | jq | grep detach > /dev/null + ak-ipfs-cat $1 | jq | grep detach > /dev/null if [ "$?" -ne 0 ] then logit "[ERROR]" "Error while extracting data from JSON for $1" exit 1 fi - DETACH="$(ipfs --timeout=10s cat $1 | jq | grep detach | sed -e 's/"detach": "//g; s/[",]//g; s/ //g')" + DETACH="$(ak-ipfs-cat $1 | jq | grep detach | sed -e 's/"detach": "//g; s/[",]//g; s/ //g')" if [ "$?" -ne 0 ] then logit "[ERROR]" "Error while extracting data from JSON for $1" @@ -54,7 +54,7 @@ then exit 1 fi gpg="$2" - ipfs --timeout=10s get $gpg > /dev/null 2>&1 + ak-ipfs-get $gpg > /dev/null 2>&1 if [ "$?" -ne 0 ] then logit "[ERROR]" "Could not get GPG key: $gpg" @@ -66,7 +66,7 @@ then logit "[ERROR]" "Could not import GPG key: $gpg" exit 1 fi - ipfs --timeout=10s get $DETACH > /dev/null 2>&1 + ak-ipfs-get $DETACH > /dev/null 2>&1 if [ "$?" -ne 0 ] then logit "[ERROR]" "Error while getting signature: $DETACH for data: $DATA" @@ -74,7 +74,7 @@ then fi mv $DETACH $DATA.asc logit "[INFO]" "Block signature downloaded" - ipfs --timeout=10s get $DATA > /dev/null 2>&1 + ak-ipfs-get $DATA > /dev/null 2>&1 if [ "$?" -ne 0 ] then logit "[ERROR]" "Error while getting data: $DATA" @@ -88,7 +88,7 @@ then exit 1 fi logit "[INFO]" "Block signature verified" - echo -n '"data":{"'$1'":'$(ipfs --timeout=10s cat $1)'},' + echo -n '"data":{"'$1'":'$(ak-ipfs-cat $1)'},' exit 0 else echo "Usage: $PROGRAM HASH GPG" |