-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "卸载完成" |