Alpine: shellcheck SC2181

pull/86/head
Meo597 2025-04-12 00:51:36 +08:00
parent 05051f5b17
commit aa7228844e
1 changed files with 4 additions and 6 deletions

View File

@ -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