From 3ff33eb33fc46556204855a437755bdc7f34a88d Mon Sep 17 00:00:00 2001 From: Ben Krieger Date: Tue, 19 Nov 2024 11:53:25 -0500 Subject: [PATCH] Format bash scripts with shfmt Signed-off-by: Ben Krieger --- examples/plugins/download_device.bash | 4 ++-- examples/plugins/download_owner.bash | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/plugins/download_device.bash b/examples/plugins/download_device.bash index ea42ef9..0e17f36 100755 --- a/examples/plugins/download_device.bash +++ b/examples/plugins/download_device.bash @@ -44,7 +44,7 @@ function yield() { fi local bytecount - bytecount="$(wc -c <"$file"|tr -d '[:space:]')" + bytecount="$(wc -c <"$file" | tr -d '[:space:]')" if [ "$bytecount" -lt "$length" ]; then # continue to wait for data return @@ -109,7 +109,7 @@ function handle() { if [[ "${next::1}" != "2" ]]; then error "expected byte array value after key $key" fi - checksum="$(openssl base64 -d <<<"${next:1}"| xxd -p -c 0|tr -d '\n')" + checksum="$(openssl base64 -d <<<"${next:1}" | xxd -p -c 0 | tr -d '\n')" ;; "data") diff --git a/examples/plugins/download_owner.bash b/examples/plugins/download_owner.bash index b747bfe..172972d 100755 --- a/examples/plugins/download_owner.bash +++ b/examples/plugins/download_owner.bash @@ -55,7 +55,7 @@ function produce() { b64 "3" "$filename" b64 "K" "length" - echo "1$(wc -c <"$file"|tr -d '[:space:]')" + echo "1$(wc -c <"$file" | tr -d '[:space:]')" b64 "K" "sha-384" b64x "2" "$(openssl dgst -sha384 -r "$file" | cut -d' ' -f1)" @@ -64,8 +64,8 @@ function produce() { fi local chunk - chunk="$(dd if="$file" skip="$index" bs=1 count="$CHUNKSIZE" 2>/dev/null|openssl base64 -A)" - ((index += $(echo -n "$chunk"|openssl base64 -A -d|wc -c))) + chunk="$(dd if="$file" skip="$index" bs=1 count="$CHUNKSIZE" 2>/dev/null | openssl base64 -A)" + ((index += $(echo -n "$chunk" | openssl base64 -A -d | wc -c))) if [ "$chunk" ]; then b64 "K" "data" @@ -105,7 +105,7 @@ function handle() { local got expected got="${next:1}" - expected="$(wc -c <"$file"|tr -d '[:space:]')" + expected="$(wc -c <"$file" | tr -d '[:space:]')" if [ "$got" -ne "$expected" ]; then error "expected device to read $expected bytes, got $got" fi