mirror of https://github.com/XTLS/Xray-install
Alpine: shellcheck
parent
b77ff248ac
commit
05051f5b17
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env ash
|
#!/usr/bin/env ash
|
||||||
|
# shellcheck shell=dash
|
||||||
|
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
|
|
||||||
|
@ -87,10 +88,10 @@ identify_architecture() {
|
||||||
}
|
}
|
||||||
|
|
||||||
install_software() {
|
install_software() {
|
||||||
if [[ -n "$(command -v curl)" ]]; then
|
if [ -n "$(command -v curl)" ]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if [[ -n "$(command -v unzip)" ]]; then
|
if [ -n "$(command -v unzip)" ]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if [ "$(command -v apk)" ]; then
|
if [ "$(command -v apk)" ]; then
|
||||||
|
@ -117,7 +118,7 @@ download_xray() {
|
||||||
verification_xray() {
|
verification_xray() {
|
||||||
CHECKSUM=$(cat "$ZIP_FILE".dgst | awk -F '= ' '/256=/ {print $2}')
|
CHECKSUM=$(cat "$ZIP_FILE".dgst | awk -F '= ' '/256=/ {print $2}')
|
||||||
LOCALSUM=$(sha256sum "$ZIP_FILE" | awk '{printf $1}')
|
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.'
|
echo 'error: SHA256 check failed! Please check your network or try again.'
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue