diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-06-24 01:26:03 +0300 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-06-24 01:26:03 +0300 |
commit | f493668bd5af77ddd7ffa1a877146d729865bd9d (patch) | |
tree | db263287740a8cda8e5fc111a13c10b0b4b6cd7b /bin | |
parent | 1f8d96cbabd235a40645d856b75b412438b0c2bc (diff) | |
download | arching-kaos-tools-f493668bd5af77ddd7ffa1a877146d729865bd9d.tar.gz arching-kaos-tools-f493668bd5af77ddd7ffa1a877146d729865bd9d.tar.bz2 arching-kaos-tools-f493668bd5af77ddd7ffa1a877146d729865bd9d.zip |
Refactoring
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ak-find-latest-mined-sblock | 6 | ||||
-rwxr-xr-x | bin/ak-fs-add | 1 | ||||
-rwxr-xr-x | bin/ak-template | 3 |
3 files changed, 5 insertions, 5 deletions
diff --git a/bin/ak-find-latest-mined-sblock b/bin/ak-find-latest-mined-sblock index effe1bb..74fa919 100755 --- a/bin/ak-find-latest-mined-sblock +++ b/bin/ak-find-latest-mined-sblock @@ -21,12 +21,12 @@ further(){ lookfor(){ echo -n $1 | grep -e '[0-9a-f]\{128\}' > /dev/null - if [ ! $? = 0 ] + if [ $? -ne 0 ] then _ak_log_error "Oops!!! The argument passed, does not match the regular expression!" else counters[$CHAIN_PARENT]="$(expr ${counters[$CHAIN_PARENT]} + 1)" - if [ ! $? = 0 ] + if [ $? -ne 0 ] then echo "$1, $counters[$1]" exit 1 @@ -35,7 +35,7 @@ lookfor(){ # echo "$1 file:" # cat "$1" | jq NEXT_TARGET="$(cat "$1" | jq | grep previous | tr -d ' ' | sed -e 's/previous//g; s/[",:]//g;')" - if [ ! "$NEXT_TARGET" = "" ] + if [ -n "$NEXT_TARGET" ] then _ak_log_info "Found previous: $NEXT_TARGET" if [ ! -f "$NEXT_TARGET" ] diff --git a/bin/ak-fs-add b/bin/ak-fs-add index 3f48d48..50833ea 100755 --- a/bin/ak-fs-add +++ b/bin/ak-fs-add @@ -1,5 +1,4 @@ #!/bin/bash -#set -x # # The concept is bit more complicated now # diff --git a/bin/ak-template b/bin/ak-template index 151d9d7..362b22e 100755 --- a/bin/ak-template +++ b/bin/ak-template @@ -20,7 +20,8 @@ example(){ } # Flags to run -if [ ! -z $1 ]; then +if [ ! -z $1 ] +then case $1 in -h | --help) _ak_usage; exit;; --example) example; exit;; |