mirror of https://github.com/XTLS/Xray-install
Migration: modify the path to fit this repo
parent
bf00022008
commit
0e5f133240
|
@ -13,7 +13,7 @@ apk add curl
|
||||||
## Download
|
## Download
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -O https://raw.githubusercontent.com/XTLS/alpinelinux-install-xray/main/install-release.sh
|
curl -O https://raw.githubusercontent.com/XTLS/Xray-install/main/alpinelinux/install-release.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
## Use
|
## Use
|
||||||
|
|
|
@ -13,7 +13,7 @@ apk add curl
|
||||||
## 下载
|
## 下载
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -O https://raw.githubusercontent.com/XTLS/alpinelinux-install-xray/main/install-release.sh
|
curl -O https://raw.githubusercontent.com/XTLS/Xray-install/main/alpinelinux/install-release.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
## 使用
|
## 使用
|
||||||
|
|
|
@ -13,7 +13,7 @@ apk add curl
|
||||||
## 下載
|
## 下載
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -O https://raw.githubusercontent.com/XTLS/alpinelinux-install-xray/main/install-release.sh
|
curl -O https://raw.githubusercontent.com/XTLS/Xray-install/main/alpinelinux/install-release.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
## 使用
|
## 使用
|
||||||
|
|
|
@ -4,54 +4,54 @@ set -euxo pipefail
|
||||||
|
|
||||||
# Identify architecture
|
# Identify architecture
|
||||||
case "$(arch -s)" in
|
case "$(arch -s)" in
|
||||||
'i386' | 'i686')
|
'i386' | 'i686')
|
||||||
MACHINE='32'
|
MACHINE='32'
|
||||||
;;
|
;;
|
||||||
'amd64' | 'x86_64')
|
'amd64' | 'x86_64')
|
||||||
MACHINE='64'
|
MACHINE='64'
|
||||||
;;
|
;;
|
||||||
'armv5tel')
|
'armv5tel')
|
||||||
MACHINE='arm32-v5'
|
MACHINE='arm32-v5'
|
||||||
;;
|
;;
|
||||||
'armv6l')
|
'armv6l')
|
||||||
MACHINE='arm32-v6'
|
MACHINE='arm32-v6'
|
||||||
grep Features /proc/cpuinfo | grep -qw 'vfp' || MACHINE='arm32-v5'
|
grep Features /proc/cpuinfo | grep -qw 'vfp' || MACHINE='arm32-v5'
|
||||||
;;
|
;;
|
||||||
'armv7' | 'armv7l')
|
'armv7' | 'armv7l')
|
||||||
MACHINE='arm32-v7a'
|
MACHINE='arm32-v7a'
|
||||||
grep Features /proc/cpuinfo | grep -qw 'vfp' || MACHINE='arm32-v5'
|
grep Features /proc/cpuinfo | grep -qw 'vfp' || MACHINE='arm32-v5'
|
||||||
;;
|
;;
|
||||||
'armv8' | 'aarch64')
|
'armv8' | 'aarch64')
|
||||||
MACHINE='arm64-v8a'
|
MACHINE='arm64-v8a'
|
||||||
;;
|
;;
|
||||||
'mips')
|
'mips')
|
||||||
MACHINE='mips32'
|
MACHINE='mips32'
|
||||||
;;
|
;;
|
||||||
'mipsle')
|
'mipsle')
|
||||||
MACHINE='mips32le'
|
MACHINE='mips32le'
|
||||||
;;
|
;;
|
||||||
'mips64')
|
'mips64')
|
||||||
MACHINE='mips64'
|
MACHINE='mips64'
|
||||||
;;
|
;;
|
||||||
'mips64le')
|
'mips64le')
|
||||||
MACHINE='mips64le'
|
MACHINE='mips64le'
|
||||||
;;
|
;;
|
||||||
'ppc64')
|
'ppc64')
|
||||||
MACHINE='ppc64'
|
MACHINE='ppc64'
|
||||||
;;
|
;;
|
||||||
'ppc64le')
|
'ppc64le')
|
||||||
MACHINE='ppc64le'
|
MACHINE='ppc64le'
|
||||||
;;
|
;;
|
||||||
'riscv64')
|
'riscv64')
|
||||||
MACHINE='riscv64'
|
MACHINE='riscv64'
|
||||||
;;
|
;;
|
||||||
's390x')
|
's390x')
|
||||||
MACHINE='s390x'
|
MACHINE='s390x'
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "error: The architecture is not supported."
|
echo "error: The architecture is not supported."
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
TMP_DIRECTORY="$(mktemp -d)/"
|
TMP_DIRECTORY="$(mktemp -d)/"
|
||||||
|
@ -87,12 +87,12 @@ 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
|
||||||
}
|
}
|
||||||
|
|
||||||
decompression() {
|
decompression() {
|
||||||
|
@ -119,7 +119,7 @@ install_confdir() {
|
||||||
if [ ! -d '/usr/local/etc/xray/' ]; then
|
if [ ! -d '/usr/local/etc/xray/' ]; then
|
||||||
install -d /usr/local/etc/xray/
|
install -d /usr/local/etc/xray/
|
||||||
for BASE in 00_log 01_api 02_dns 03_routing 04_policy 05_inbounds 06_outbounds 07_transport 08_stats 09_reverse; do
|
for BASE in 00_log 01_api 02_dns 03_routing 04_policy 05_inbounds 06_outbounds 07_transport 08_stats 09_reverse; do
|
||||||
echo '{}' > "/usr/local/etc/xray/$BASE.json"
|
echo '{}' >"/usr/local/etc/xray/$BASE.json"
|
||||||
done
|
done
|
||||||
CONFDIR='1'
|
CONFDIR='1'
|
||||||
fi
|
fi
|
||||||
|
@ -139,7 +139,7 @@ install_startup_service_file() {
|
||||||
OPENRC='0'
|
OPENRC='0'
|
||||||
if [ ! -f '/etc/init.d/xray' ]; then
|
if [ ! -f '/etc/init.d/xray' ]; then
|
||||||
mkdir "${TMP_DIRECTORY}init.d/"
|
mkdir "${TMP_DIRECTORY}init.d/"
|
||||||
curl -o "${TMP_DIRECTORY}init.d/xray" https://raw.githubusercontent.com/XTLS/alpinelinux-install-xray/main/init.d/xray -s
|
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 [ "$?" -ne '0' ]; then
|
||||||
echo 'error: Failed to start service file download! Please check your network or try again.'
|
echo 'error: Failed to start service file download! Please check your network or try again.'
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in New Issue