Skip to content

Commit

Permalink
add: uninstall sh
Browse files Browse the repository at this point in the history
  • Loading branch information
huhu415 committed Nov 11, 2024
1 parent cfffed8 commit 28d1366
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ release:
header: |
## 🥳Changes
- 增加自动安装脚本, 一键安装
- 加强了一点性能
- 增加卸载功能
```sh
tar -xzvf uaProxy-linux-xxxxxxx.tar.gz # 解压
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ iptables -t nat -A OUTPUT -p tcp -j uaProxy # 对本机进行透明代理, 可

### 脚本安装
```sh
curl https://raw.githubusercontent.com/huhu415/uaProxy/refs/heads/main/assets/autoInstall.sh | sh
curl https://raw.githubusercontent.com/huhu415/uaProxy/refs/heads/main/assets/Install.sh | sh
```
> 脚本安装只支持`小端`架构, 因为我还没搞明白怎么检测`大端`架构, `大端`机器太少了.
Expand Down
File renamed without changes.
32 changes: 32 additions & 0 deletions assets/UnInstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh

# 检查是否为root用户
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root"
exit 1
fi

# 停止服务
/etc/init.d/uaProxy-openwrt stop

# 清理 iptables 规则
echo "正在清理 iptables 规则..."
iptables -t nat -F # 清空 nat 表
iptables -t nat -X uaProxy || {
echo "删除 iptables 链规则失败"
# 这里不退出,继续执行后续卸载步骤
}

# 删除可执行文件
rm -f /usr/sbin/uaProxy || {
echo "删除 uaProxy 失败"
exit 1
}

# 删除启动脚本
rm -f /etc/init.d/uaProxy-openwrt || {
echo "删除 uaProxy-openwrt 失败"
exit 1
}

echo "卸载完成"

0 comments on commit 28d1366

Please sign in to comment.