Skip to content

Commit

Permalink
upgrade to 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
yangliu committed Feb 6, 2021
1 parent b7256f8 commit 0718b58
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
7 changes: 4 additions & 3 deletions scripts/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh
ver="0.1.1"

if [ -z ${1} ]; then
acg_path="/opt/acg"
Expand All @@ -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"
Expand Down

0 comments on commit 0718b58

Please sign in to comment.