Skip to content

Commit

Permalink
Update uninstall.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
CH3NGYZ authored Sep 8, 2023
1 parent 23e5890 commit 8303210
Showing 1 changed file with 33 additions and 16 deletions.
49 changes: 33 additions & 16 deletions uninstall.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
#!/bin/sh

/tmp/tailscale down --accept-risk=lose-ssh
/tmp/tailscale logout
/etc/init.d/tailscale disable
/etc/init.d/tailscale stop
ip link delete tailscale0
rm -rf /etc/tailscale*
rm -rf /etc/config/tailscale*
rm -rf /etc/init.d/tailscale*
rm -rf /usr/bin/tailscale*
rm -rf /tmp/tailscale*
rm -rf /var/lib/tailscale*
echo "已清除配置文件, 正在查找残余文件, 此步需要的时间较久,请耐心等待"
cd /
find . -type f -name "*tailscale*" -exec rm -f {} +
find . -type d -name "*tailscale*" -exec rm -rf {} +
echo "已清除, 强烈推荐重启您的openwrt"
cleanup() {
echo "已清除配置文件,正在查找残余文件,此步需要的时间较久,请耐心等待"
cd /
find . -type f -name "*tailscale*" -exec rm -f {} +
find . -type d -name "*tailscale*" -exec rm -rf {} +
echo "已清除,强烈推荐重启您的OpenWRT"
}

if [ ! -e /tmp/tailscaled ]; then
echo "文件不存在,执行清除操作"
/tmp/tailscale down --accept-risk=lose-ssh
/tmp/tailscale logout
/etc/init.d/tailscale disable
/etc/init.d/tailscale stop
rm -rf /etc/tailscale*
rm -rf /etc/config/tailscale*
rm -rf /etc/init.d/tailscale*
rm -rf /usr/bin/tailscale*
rm -rf /tmp/tailscale*
rm -rf /var/lib/tailscale*
ip link delete tailscale0
cleanup
else
echo "文件存在,执行清除操作"
rm -rf /etc/tailscale*
rm -rf /etc/config/tailscale*
rm -rf /etc/init.d/tailscale*
rm -rf /usr/bin/tailscale*
rm -rf /tmp/tailscale*
rm -rf /var/lib/tailscale*
ip link delete tailscale0
cleanup
fi

0 comments on commit 8303210

Please sign in to comment.