From 05051f5b17c2c36d92ce0e145da4cfe28b7c18de Mon Sep 17 00:00:00 2001 From: Meo597 <197331664+Meo597@users.noreply.github.com> Date: Sat, 12 Apr 2025 00:45:52 +0800 Subject: [PATCH] Alpine: shellcheck --- alpinelinux/install-release.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/alpinelinux/install-release.sh b/alpinelinux/install-release.sh index 4c4c95e..49814a6 100644 --- a/alpinelinux/install-release.sh +++ b/alpinelinux/install-release.sh @@ -1,4 +1,5 @@ #!/usr/bin/env ash +# shellcheck shell=dash set -euxo pipefail @@ -87,10 +88,10 @@ identify_architecture() { } install_software() { - if [[ -n "$(command -v curl)" ]]; then + if [ -n "$(command -v curl)" ]; then return fi - if [[ -n "$(command -v unzip)" ]]; then + if [ -n "$(command -v unzip)" ]; then return fi if [ "$(command -v apk)" ]; then @@ -117,7 +118,7 @@ download_xray() { verification_xray() { CHECKSUM=$(cat "$ZIP_FILE".dgst | awk -F '= ' '/256=/ {print $2}') LOCALSUM=$(sha256sum "$ZIP_FILE" | awk '{printf $1}') - if [[ "$CHECKSUM" != "$LOCALSUM" ]]; then + if [ "$CHECKSUM" != "$LOCALSUM" ]; then echo 'error: SHA256 check failed! Please check your network or try again.' return 1 fi