From 4f20f46565b543076b224663db9f77358aa2d9c7 Mon Sep 17 00:00:00 2001 From: xzx3344521 Date: Tue, 21 Oct 2025 00:51:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E9=80=9F=E8=BD=AF=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 测速软件 --- 测速软件 | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 测速软件 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