From 10c50c113fe6260ddf02df85b81b6af91d9225f0 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Wed, 27 Mar 2024 10:43:47 +0200 Subject: Removed obsolete scripts --- README | 21 --------------------- bin/ak-ipfs-add | 10 ---------- bin/ak-ipfs-block-stat | 8 -------- bin/ak-ipfs-cat | 9 --------- bin/ak-ipfs-check | 45 --------------------------------------------- bin/ak-ipfs-files-cp | 8 -------- bin/ak-ipfs-files-ls | 8 -------- bin/ak-ipfs-files-mkdir | 8 -------- bin/ak-ipfs-files-mv | 8 -------- bin/ak-ipfs-files-rm | 8 -------- bin/ak-ipfs-files-stat | 8 -------- bin/ak-ipfs-get | 8 -------- bin/ak-ipfs-key-gen | 8 -------- bin/ak-ipfs-key-list | 8 -------- bin/ak-ipfs-key-list-full | 8 -------- bin/ak-ipfs-name-publish | 9 --------- bin/ak-ipfs-name-resolve | 9 --------- bin/ak-ipfs-swarm-peers | 8 -------- bin/ak-ipns-resolve | 26 -------------------------- lib/_ak_ipfs | 2 +- 20 files changed, 1 insertion(+), 226 deletions(-) delete mode 100755 bin/ak-ipfs-add delete mode 100755 bin/ak-ipfs-block-stat delete mode 100755 bin/ak-ipfs-cat delete mode 100755 bin/ak-ipfs-check delete mode 100755 bin/ak-ipfs-files-cp delete mode 100755 bin/ak-ipfs-files-ls delete mode 100755 bin/ak-ipfs-files-mkdir delete mode 100755 bin/ak-ipfs-files-mv delete mode 100755 bin/ak-ipfs-files-rm delete mode 100755 bin/ak-ipfs-files-stat delete mode 100755 bin/ak-ipfs-get delete mode 100755 bin/ak-ipfs-key-gen delete mode 100755 bin/ak-ipfs-key-list delete mode 100755 bin/ak-ipfs-key-list-full delete mode 100755 bin/ak-ipfs-name-publish delete mode 100755 bin/ak-ipfs-name-resolve delete mode 100755 bin/ak-ipfs-swarm-peers delete mode 100755 bin/ak-ipns-resolve diff --git a/README b/README index 9423d15..71397bf 100644 --- a/README +++ b/README @@ -314,27 +314,6 @@ Deprecated ---------- ak-json2bash -Obsolete --------- -ak-ipfs-add -ak-ipfs-block-stat -ak-ipfs-cat -ak-ipfs-check -ak-ipfs-files-cp -ak-ipfs-files-ls -ak-ipfs-files-mkdir -ak-ipfs-files-mv -ak-ipfs-files-rm -ak-ipfs-files-stat -ak-ipfs-get -ak-ipfs-key-gen -ak-ipfs-key-list -ak-ipfs-key-list-full -ak-ipfs-name-publish -ak-ipfs-name-resolve -ak-ipfs-swarm-peers -ak-ipns-resolve - Debugging --------- diff --git a/bin/ak-ipfs-add b/bin/ak-ipfs-add deleted file mode 100755 index 4cedcec..0000000 --- a/bin/ak-ipfs-add +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -PROGRAM="$(basename $0)" -# Receives a file -# Returns a hash -ipfs add -Qr "$1" -if [ "$?" != "0" ] -then - ak-logthis "$PROGRAM" "ERROR" "Failed to add $1" - exit 1 -fi diff --git a/bin/ak-ipfs-block-stat b/bin/ak-ipfs-block-stat deleted file mode 100755 index b049a70..0000000 --- a/bin/ak-ipfs-block-stat +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -PROGRAM="$(basename $0)" -ipfs block stat "$1" -if [ "$?" != "0" ] -then - ak-logthis "$PROGRAM" "ERROR" "Failed to retrieve stat of block $1" - exit 1 -fi diff --git a/bin/ak-ipfs-cat b/bin/ak-ipfs-cat deleted file mode 100755 index 2adf00e..0000000 --- a/bin/ak-ipfs-cat +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -PROGRAM="$(basename $0)" -ipfs --timeout=10s cat $1 -if [ "$?" -ne "0" ] -then - ak-logthis "$PROGRAM" "ERROR" "Failed to cat $1" - exit 1 -fi - diff --git a/bin/ak-ipfs-check b/bin/ak-ipfs-check deleted file mode 100755 index f74f040..0000000 --- a/bin/ak-ipfs-check +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -PROGRAM="$(basename $0)" -source $AK_LIBDIR/_ak_logit - -ak-ipfs-files-ls /zarchive > /dev/null -if [ $? != 0 ] -then - logit "ERROR" "/zarchive is missing" -else - logit "INFO" "/zarchive OK" -fi - -ak-ipfs-files-ls /zlatest > /dev/null -if [ $? != 0 ] -then - logit "ERROR" "/zlatest is missing" -else - logit "INFO" "/zlatest is OK" -fi - -ak-ipfs-key-list | grep zchain > /dev/null -if [ $? != 0 ]; then - logit "WARNING" "zchain key is missing" - ak-ipfs-key-gen zchain > $ZCHAIN - if [ $? != 0 ]; then - logit "ERROR" "zchain fails to create" - else - logit "INFO" "zchain created" - fi -else - logit "INFO" "zchain is there" -fi - -ak-ipfs-key-list | grep ak-config > /dev/null -if [ $? != 0 ]; then - logit "WARNING" "ak-config key is missing" - ak-ipfs-key-gen ak-config - if [ $? != 0 ]; then - logit "ERROR" "ak-config fails to create" - else - logit "INFO" "ak-config created" - fi -else - logit "INFO" "ak-config is there" -fi diff --git a/bin/ak-ipfs-files-cp b/bin/ak-ipfs-files-cp deleted file mode 100755 index 37a878a..0000000 --- a/bin/ak-ipfs-files-cp +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -PROGRAM="$(basename $0)" -ipfs files cp "$1" "$2" -if [ "$?" != "0" ] -then - ak-logthis "$PROGRAM" "ERROR" "Failed to copy $1 to $2" - exit 1 -fi diff --git a/bin/ak-ipfs-files-ls b/bin/ak-ipfs-files-ls deleted file mode 100755 index 80fc899..0000000 --- a/bin/ak-ipfs-files-ls +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -PROGRAM="$(basename $0)" -ipfs files ls "$1" -if [ "$?" != "0" ] -then - ak-logthis "$PROGRAM" "ERROR" "Failed to list $1" - exit 1 -fi diff --git a/bin/ak-ipfs-files-mkdir b/bin/ak-ipfs-files-mkdir deleted file mode 100755 index d6fb298..0000000 --- a/bin/ak-ipfs-files-mkdir +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -PROGRAM="$(basename $0)" -ipfs files mkdir "$1" -if [ "$?" != "0" ] -then - ak-logthis "$PROGRAM" "ERROR" "Failed to mkdir $1" - exit 1 -fi diff --git a/bin/ak-ipfs-files-mv b/bin/ak-ipfs-files-mv deleted file mode 100755 index 67fa9b0..0000000 --- a/bin/ak-ipfs-files-mv +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -PROGRAM="$(basename $0)" -ipfs files mv "$1" "$2" -if [ "$?" != "0" ] -then - ak-logthis "$PROGRAM" "ERROR" "Failed to move $1 to $2" - exit 1 -fi diff --git a/bin/ak-ipfs-files-rm b/bin/ak-ipfs-files-rm deleted file mode 100755 index cd5cb02..0000000 --- a/bin/ak-ipfs-files-rm +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -PROGRAM="$(basename $0)" -ipfs files rm "$1" -if [ "$?" != "0" ] -then - ak-logthis "$PROGRAM" "ERROR" "Failed to remove $1" - exit 1 -fi diff --git a/bin/ak-ipfs-files-stat b/bin/ak-ipfs-files-stat deleted file mode 100755 index 09fda0f..0000000 --- a/bin/ak-ipfs-files-stat +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -PROGRAM="$(basename $0)" -ipfs files stat "$1" -if [ "$?" != "0" ] -then - ak-logthis "$PROGRAM" "ERROR" "Failed to get file's stats $1" - exit 1 -fi diff --git a/bin/ak-ipfs-get b/bin/ak-ipfs-get deleted file mode 100755 index dedf503..0000000 --- a/bin/ak-ipfs-get +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -PROGRAM="$(basename $0)" -ipfs --timeout=10s get "$1" > /dev/null 2>&1 -if [ "$?" != "0" ] -then - ak-logthis "$PROGRAM" "ERROR" "Failed to get $1" - exit 1 -fi diff --git a/bin/ak-ipfs-key-gen b/bin/ak-ipfs-key-gen deleted file mode 100755 index 0ef5fe8..0000000 --- a/bin/ak-ipfs-key-gen +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -PROGRAM="$(basename $0)" -ipfs key gen "$1" -if [ "$?" != "0" ] -then - ak-logthis "$PROGRAM" "ERROR" "Failed to generate key $1" - exit 1 -fi diff --git a/bin/ak-ipfs-key-list b/bin/ak-ipfs-key-list deleted file mode 100755 index b36cba1..0000000 --- a/bin/ak-ipfs-key-list +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -PROGRAM="$(basename $0)" -ipfs key list -if [ "$?" != "0" ] -then - ak-logthis "$PROGRAM" "ERROR" "Failed to get key list" - exit 1 -fi diff --git a/bin/ak-ipfs-key-list-full b/bin/ak-ipfs-key-list-full deleted file mode 100755 index 9ee3347..0000000 --- a/bin/ak-ipfs-key-list-full +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -PROGRAM="$(basename $0)" -ipfs key list -l -if [ "$?" != "0" ] -then - ak-logthis "$PROGRAM" "ERROR" "Failed to get key list" - exit 1 -fi diff --git a/bin/ak-ipfs-name-publish b/bin/ak-ipfs-name-publish deleted file mode 100755 index 60169ed..0000000 --- a/bin/ak-ipfs-name-publish +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -PROGRAM="$(basename $0)" -ipfs name publish "$1" "$2" -if [ "$?" != "0" ] -then - ak-logthis "$PROGRAM" "ERROR" "Failed to get $1" - exit 1 -fi - diff --git a/bin/ak-ipfs-name-resolve b/bin/ak-ipfs-name-resolve deleted file mode 100755 index 32172c0..0000000 --- a/bin/ak-ipfs-name-resolve +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -PROGRAM="$(basename $0)" -ipfs name resolve "$1" -if [ "$?" != "0" ] -then - ak-logthis "$PROGRAM" "ERROR" "Failed to resolve $1" - exit 1 -fi - diff --git a/bin/ak-ipfs-swarm-peers b/bin/ak-ipfs-swarm-peers deleted file mode 100755 index eb67346..0000000 --- a/bin/ak-ipfs-swarm-peers +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -PROGRAM="$(basename $0)" -ipfs swarm peers -if [ "$?" != "0" ] -then - ak-logthis "$PROGRAM" "ERROR" "Failed to get list of peers" - exit 1 -fi diff --git a/bin/ak-ipns-resolve b/bin/ak-ipns-resolve deleted file mode 100755 index 0dc7697..0000000 --- a/bin/ak-ipns-resolve +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -PROGRAM="$(basename $0)" -usage(){ - echo "$PROGRAM - Resolves IPNS to IPFS" - echo "------------------------------------" - echo "Usage:" - echo " $PROGRAM " - echo "" - echo "Returns the resolved IPFS CIDv0" -} -source $AK_LIBDIR/_ak_logit - -if [ ! -z $1 ] -then - rsld=$(ak-ipfs-name-resolve $1) - if [ "$?" != 0 ] - then - logit "ERROR" "Failed to resolve $1" - exit 1 - fi - echo -n $rsld | sed -e 's/\/ipfs\///' - logit "INFO" "Resolved $1 to $rsld" -else - usage -fi - diff --git a/lib/_ak_ipfs b/lib/_ak_ipfs index 4e7f846..71bdb93 100755 --- a/lib/_ak_ipfs +++ b/lib/_ak_ipfs @@ -225,7 +225,7 @@ _ak_ipns_resolve(){ if [ ! -z $1 ] then rsld=$(ak-ipfs-name-resolve $1) - if [ "$?" != 0 ] + if [ $? -ne 0 ] then logit "ERROR" "Failed to resolve $1" exit 1 -- cgit v1.2.3