This commit is contained in:
Your Name
2024-11-12 00:07:46 +08:00
commit b00f025742
24 changed files with 1912 additions and 0 deletions

41
tailscale_script.sh Normal file
View File

@@ -0,0 +1,41 @@
#!/bin/bash
# 检查并安装 curl
check_and_install_curl() {
if ! command -v curl &> /dev/null; then
echo "curl 未安装。正在尝试安装 curl..."
sudo apt-get update && sudo apt-get install curl -y
echo "curl 已安装。"
else
echo "curl 已安装。"
fi
}
# 安装 Tailscale
install_tailscale() {
check_and_install_curl
echo "正在安装 Tailscale..."
curl -fsSL https://tailscale.com/install.sh | sudo sh
echo "Tailscale 已安装。"
}
# 卸载 Tailscale
uninstall_tailscale() {
echo "正在卸载 Tailscale..."
sudo apt-get remove --purge tailscale -y
echo "Tailscale 已卸载。"
}
# 用户界面
echo "选择操作:"
echo "1) 安装 Tailscale"
echo "2) 卸载 Tailscale"
echo "3) 退出"
read -p "输入选择1-3" choice
case $choice in
1) install_tailscale ;;
2) uninstall_tailscale ;;
3) exit 0 ;;
*) echo "无效输入。" ;;
esac