diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-06-14 23:33:03 +0300 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-06-14 23:33:03 +0300 |
commit | 4cbcd6cf97ae49c5c58cd4004d7a097ceb71388a (patch) | |
tree | 75a5ff2d80b6ea7012cd84139c4dc3e48e9e2be5 | |
parent | 4217dc0560bf40b4fa7ae6a6f964bd56b418712e (diff) | |
download | arching-kaos-tools-4cbcd6cf97ae49c5c58cd4004d7a097ceb71388a.tar.gz arching-kaos-tools-4cbcd6cf97ae49c5c58cd4004d7a097ceb71388a.tar.bz2 arching-kaos-tools-4cbcd6cf97ae49c5c58cd4004d7a097ceb71388a.zip |
(new) ak-gpg: Wrapper around lib/ak-gpg
-rwxr-xr-x | bin/ak-get-gpg | 3 | ||||
-rwxr-xr-x | bin/ak-get-gpg-fingerprint | 11 | ||||
-rwxr-xr-x | bin/ak-gpg | 37 | ||||
-rwxr-xr-x | bin/ak-miner-script | 2 |
4 files changed, 38 insertions, 15 deletions
diff --git a/bin/ak-get-gpg b/bin/ak-get-gpg deleted file mode 100755 index e441f87..0000000 --- a/bin/ak-get-gpg +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -source $AK_LIBDIR/_ak_gpg -_ak_gpg_key_self_get_fingerprint_from_config diff --git a/bin/ak-get-gpg-fingerprint b/bin/ak-get-gpg-fingerprint deleted file mode 100755 index 84025e5..0000000 --- a/bin/ak-get-gpg-fingerprint +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -source $AK_LIBDIR/_ak_gpg - -if [ -z $1 ] -then - _ak_gpg_key_self_get_fingerprint -elif [ -n "$1" ] -then - _ak_gpg_key_get_fingerprint_from_ipfs $1 -fi - diff --git a/bin/ak-gpg b/bin/ak-gpg new file mode 100755 index 0000000..5ff9e6e --- /dev/null +++ b/bin/ak-gpg @@ -0,0 +1,37 @@ +#!/bin/bash +## +## It is a minimal wrapper aroung lib/_ak_gpg. +## +## Usage: +## +## -h, --help Prints this help message +## +## --get-key-self-as-ipfs Returns your key as an IPFS hash +## +## --get-key-self-as-fingerprint Returns the fingerprint of your key +## +## --get-key-fingerprint-from-ipfs Returns the fingerprint of a given key +## +fullprogrampath="$(realpath $0)" +PROGRAM=$(basename $0) +descriptionString="GPG cli tool" + +# At least these +source $AK_LIBDIR/_ak_log +source $AK_LIBDIR/_ak_script +source $AK_LIBDIR/_ak_gpg + + + +# Flags to run +if [ ! -z $1 ]; then + case $1 in + -h | --help) _ak_usage; exit;; + --example) example; exit;; + --get-key-self-as-ipfs) _ak_gpg_key_self_get_fingerprint_from_config; exit;; + --get-key-self-as-fingerprint) _ak_gpg_key_self_get_fingerprint; exit;; + --get-key-fingerprint-from-ipfs) _ak_gpg_key_get_fingerprint_from_ipfs $1; exit;; + * ) _ak_usage;; + esac +else _ak_usage +fi diff --git a/bin/ak-miner-script b/bin/ak-miner-script index caa74d1..9119b0c 100755 --- a/bin/ak-miner-script +++ b/bin/ak-miner-script @@ -24,7 +24,7 @@ proofofwork(){ # Static difficulty for securing the sblock echo $SHA | grep -e '^000' - if [ "$?" == 0 ] ; + if [ $? -eq 0 ] then echo "SHA512 is $SHA" echo "Mined block:" |