From aa7228844e6421c35542cdba34cd52b6338ecbd1 Mon Sep 17 00:00:00 2001 From: Meo597 <197331664+Meo597@users.noreply.github.com> Date: Sat, 12 Apr 2025 00:51:36 +0800 Subject: [PATCH] Alpine: shellcheck SC2181 --- alpinelinux/install-release.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/alpinelinux/install-release.sh b/alpinelinux/install-release.sh index 49814a6..d3781ec 100644 --- a/alpinelinux/install-release.sh +++ b/alpinelinux/install-release.sh @@ -103,13 +103,12 @@ install_software() { } download_xray() { - curl -L -H 'Cache-Control: no-cache' -o "$ZIP_FILE" "$DOWNLOAD_LINK" -# - if [ "$?" -ne '0' ]; then + if ! curl -L -H 'Cache-Control: no-cache' -o "$ZIP_FILE" "$DOWNLOAD_LINK" -#; then echo 'error: Download failed! Please check your network or try again.' exit 1 fi - curl -L -H 'Cache-Control: no-cache' -o "$ZIP_FILE.dgst" "$DOWNLOAD_LINK.dgst" -# - if [ "$?" -ne '0' ]; then + + if ! curl -L -H 'Cache-Control: no-cache' -o "$ZIP_FILE.dgst" "$DOWNLOAD_LINK.dgst" -#; then echo 'error: Download failed! Please check your network or try again.' exit 1 fi @@ -168,8 +167,7 @@ install_startup_service_file() { OPENRC='0' if [ ! -f '/etc/init.d/xray' ]; then mkdir "${TMP_DIRECTORY}init.d/" - curl -o "${TMP_DIRECTORY}init.d/xray" https://raw.githubusercontent.com/XTLS/Xray-install/main/alpinelinux/init.d/xray -s - if [ "$?" -ne '0' ]; then + if ! curl -o "${TMP_DIRECTORY}init.d/xray" https://raw.githubusercontent.com/XTLS/Xray-install/main/alpinelinux/init.d/xray -s; then echo 'error: Failed to start service file download! Please check your network or try again.' exit 1 fi