diff --git a/测速软件 b/测速软件 new file mode 100644 index 0000000..99b0e20 --- /dev/null +++ b/测速软件 @@ -0,0 +1,47 @@ +# 创建简化安装脚本 +cat > /tmp/install-lg.sh << 'EOF' +#!/bin/bash +echo "Looking Glass 快速安装脚本" + +# 检查 Docker +if ! command -v docker &> /dev/null; then + echo "错误: Docker 未安装" + exit 1 +fi + +# 设置默认值 +HTTP_PORT=801 +CONTAINER_NAME="looking-glass" + +# 停止已存在的容器 +docker stop $CONTAINER_NAME 2>/dev/null || true +docker rm $CONTAINER_NAME 2>/dev/null || true + +# 交互式配置 +read -p "请输入 HTTP 端口 (默认: 80): " custom_port +if [ -n "$custom_port" ]; then + HTTP_PORT=$custom_port +fi + +read -p "请输入服务器位置描述: " location +LOCATION_OPT="" +if [ -n "$location" ]; then + LOCATION_OPT="-e LOCATION=\"$location\"" +fi + +# 运行容器 +echo "正在启动 Looking Glass 容器..." +docker run -d \ + --name $CONTAINER_NAME \ + -e HTTP_PORT=$HTTP_PORT \ + $LOCATION_OPT \ + --restart always \ + --network host \ + wikihostinc/looking-glass-server + +echo "安装完成!" +echo "访问地址: http://$(hostname -I | awk '{print $1}'):$HTTP_PORT" +EOF + +chmod +x /tmp/install-lg.sh +/tmp/install-lg.sh