diff --git a/README.md b/README.md index 5408b6a..d4efe8a 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ Quickly convert your Alpine Linux host/vm into a Clash-based gateway. 2. Please configure your network during the installation. Static IP is recommended but not mandatory. 3. Run following command ``` -wget -O - https://cdn.jsdelivr.net/gh/yangliu/alpine-clash-gateway@main/scripts/install.sh | sh +wget -O - https://cdn.jsdelivr.net/gh/yangliu/alpine-clash-gateway@0.1.1/scripts/install.sh | sh ``` or ``` -wget -O - https://cdn.jsdelivr.net/gh/yangliu/alpine-clash-gateway@main/scripts/install.sh | sh -s /etc/acg +wget -O - https://cdn.jsdelivr.net/gh/yangliu/alpine-clash-gateway@0.1.1/scripts/install.sh | sh -s /etc/acg ``` \ No newline at end of file diff --git a/scripts/install.sh b/scripts/install.sh index 75bf684..1562620 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1,4 +1,5 @@ #!/bin/sh +ver="0.1.1" if [ -z ${1} ]; then acg_path="/opt/acg" @@ -9,10 +10,10 @@ fi [ ! -d "${acg_path}" ] && mkdir -p "${acg_path}" [ -f /tmp/acg.zip ] && rm /tmp/acg.zip -[ -d /tmp/alpine-clash-gateway-main ] && rm -rf /tmp/alpine-clash-gateway-main -wget -O /tmp/acg.zip https://github.com/yangliu/alpine-clash-gateway/archive/main.zip +[ -d "/tmp/alpine-clash-gateway-${ver}" ] && rm -rf "/tmp/alpine-clash-gateway-${ver}" +wget -O /tmp/acg.zip "https://github.com/yangliu/alpine-clash-gateway/archive/${ver}.zip" unzip /tmp/acg.zip -d /tmp -cp -R /tmp/alpine-clash-gateway-main/* "${acg_path}/" +cp -R /tmp/alpine-clash-gateway-${ver}/* "${acg_path}/" escaped_acg_path=$(printf '%s\n' "${acg_path}" | sed -e 's/[]\/$*.^[]/\\&/g'); sed -i "s/acg_path=\"\/opt\/acg\"/acg_path=\"${escaped_acg_path}\"/g" "${acg_path}/files/acg" sed -i "s/acg_path=\"\/opt\/acg\"/acg_path=\"${escaped_acg_path}\"/g" "${acg_path}/scripts/clash-proxy"