From c0416db0a7ab08e1d828a190e70fe996e9ed5c82 Mon Sep 17 00:00:00 2001 From: eddy <1036636139@qq.com> Date: Fri, 7 Nov 2025 14:32:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=B9=E9=85=8D=E4=BB=93=E5=BA=93=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E6=96=87=E4=BB=B6=E5=AE=8C=E6=88=90=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 88 ++++-------------------------------------------- v2raya/v2raya.sh | 25 +++++++++++--- 2 files changed, 27 insertions(+), 86 deletions(-) diff --git a/README.md b/README.md index c33bd18..5880042 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,17 @@ -# vps +## vps vps脚本 -## 初始化脚本 (init) - -- 00-disable-password -```sh -curl -sS -O https://gitea.tohub.top/Share/vps/raw/branch/main/init/00-disable-password.sh && chmod +x 00-disable-password.sh && ./00-disable-password.sh -``` - -- 01-sysUpdate +- sysUpdate ```sh curl -sS -O https://gitea.tohub.top/Share/vps/raw/branch/main/init/01-sysUpdate.sh && chmod +x 01-sysUpdate.sh && ./01-sysUpdate.sh ``` -- 02-sysCleanup +- sysCleanup ```sh curl -sS -O https://gitea.tohub.top/Share/vps/raw/branch/main/init/02-sysCleanup.sh && chmod +x 02-sysCleanup.sh && ./02-sysCleanup.sh ``` -- 03-docker +- docker ```sh curl -sS -O https://gitea.tohub.top/Share/vps/raw/branch/main/init/03-docker.sh && chmod +x 03-docker.sh && ./03-docker.sh ``` @@ -38,74 +31,7 @@ curl -sS -O https://gitea.tohub.top/Share/vps/raw/branch/main/init/vps_init.sh & curl -sS -O https://gitea.tohub.top/Share/vps/raw/branch/main/init/xray-manager.sh && chmod +x xray-manager.sh && ./xray-manager.sh ``` -## 安装脚本 (install) - -- 01-Nginx -```sh -curl -sS -O https://gitea.tohub.top/Share/vps/raw/branch/main/install/01-Nginx.sh && chmod +x 01-Nginx.sh && ./01-Nginx.sh -``` - -- 02-NginxProxy -```sh -curl -sS -O https://gitea.tohub.top/Share/vps/raw/branch/main/install/02-NginxProxy.sh && chmod +x 02-NginxProxy.sh && ./02-NginxProxy.sh -``` - -- 03-X-UI -```sh -curl -sS -O https://gitea.tohub.top/Share/vps/raw/branch/main/install/03-X-UI.sh && chmod +x 03-X-UI.sh && ./03-X-UI.sh -``` - -- 04-FRP -```sh -curl -sS -O https://gitea.tohub.top/Share/vps/raw/branch/main/install/04-FRP.sh && chmod +x 04-FRP.sh && ./04-FRP.sh -``` - -- 05-ZeroTier -```sh -curl -sS -O https://gitea.tohub.top/Share/vps/raw/branch/main/install/05-ZeroTier.sh && chmod +x 05-ZeroTier.sh && ./05-ZeroTier.sh -``` - -- 06-Rustdesk -```sh -curl -sS -O https://gitea.tohub.top/Share/vps/raw/branch/main/install/06-Rustdesk.sh && chmod +x 06-Rustdesk.sh && ./06-Rustdesk.sh -``` - -- 07-Alist -```sh -curl -sS -O https://gitea.tohub.top/Share/vps/raw/branch/main/install/07-Alist.sh && chmod +x 07-Alist.sh && ./07-Alist.sh -``` - -- 08-Duplicati -```sh -curl -sS -O https://gitea.tohub.top/Share/vps/raw/branch/main/install/08-Duplicati.sh && chmod +x 08-Duplicati.sh && ./08-Duplicati.sh -``` - -- 09-Syncthing -```sh -curl -sS -O https://gitea.tohub.top/Share/vps/raw/branch/main/install/09-Syncthing.sh && chmod +x 09-Syncthing.sh && ./09-Syncthing.sh -``` - -- 10-Vaultwarden -```sh -curl -sS -O https://gitea.tohub.top/Share/vps/raw/branch/main/install/10-Vaultwarden.sh && chmod +x 10-Vaultwarden.sh && ./10-Vaultwarden.sh -``` - -- 11-EasyImage -```sh -curl -sS -O https://gitea.tohub.top/Share/vps/raw/branch/main/install/11-EasyImage.sh && chmod +x 11-EasyImage.sh && ./11-EasyImage.sh -``` - -- 12-Wordpress -```sh -curl -sS -O https://gitea.tohub.top/Share/vps/raw/branch/main/install/12-Wordpress.sh && chmod +x 12-Wordpress.sh && ./12-Wordpress.sh -``` - -- 13-Nextcloud -```sh -curl -sS -O https://gitea.tohub.top/Share/vps/raw/branch/main/install/13-Nextcloud.sh && chmod +x 13-Nextcloud.sh && ./13-Nextcloud.sh -``` - -- 14-Joplin -```sh -curl -sS -O https://gitea.tohub.top/Share/vps/raw/branch/main/install/14-Joplin.sh && chmod +x 14-Joplin.sh && ./14-Joplin.sh +- v2raya +```sh +curl -sS -O https://gitea.tohub.top/Share/vps/raw/branch/main/v2raya/v2raya.sh && chmod +x v2raya.sh && ./v2raya.sh ``` diff --git a/v2raya/v2raya.sh b/v2raya/v2raya.sh index 4235045..ab5a0aa 100644 --- a/v2raya/v2raya.sh +++ b/v2raya/v2raya.sh @@ -59,6 +59,16 @@ detect_arch() { fi } +# 转换架构名称(用于 V2rayA 文件命名) +get_v2raya_arch() { + local arch=$1 + if [[ "$arch" == "amd64" ]]; then + echo "x64" + else + echo "$arch" + fi +} + # 创建安装目录 create_install_dir() { if [[ ! -d "$INSTALL_DIR" ]]; then @@ -106,12 +116,13 @@ download_file() { # 下载安装包 download_packages() { local arch=$(detect_arch) + local v2raya_arch=$(get_v2raya_arch "$arch") print_info "检测到系统架构: $arch" create_install_dir local xray_file="xray_${XRAY_VERSION}_${arch}.deb" - local v2raya_file="v2raya_${V2RAYA_VERSION}_${arch}.deb" + local v2raya_file="v2raya_${v2raya_arch}_${V2RAYA_VERSION}.deb" local download_failed=0 # 下载 Xray @@ -174,8 +185,9 @@ verify_deb_file() { # 安装 V2rayA install_v2raya() { local arch=$(detect_arch) + local v2raya_arch=$(get_v2raya_arch "$arch") local xray_file="$INSTALL_DIR/xray_${XRAY_VERSION}_${arch}.deb" - local v2raya_file="$INSTALL_DIR/v2raya_${V2RAYA_VERSION}_${arch}.deb" + local v2raya_file="$INSTALL_DIR/v2raya_${v2raya_arch}_${V2RAYA_VERSION}.deb" # 检查文件是否存在 if [[ ! -f "$xray_file" ]] || [[ ! -f "$v2raya_file" ]]; then @@ -256,8 +268,9 @@ install_v2raya() { # 卸载 V2rayA uninstall_v2raya() { local arch=$(detect_arch) + local v2raya_arch=$(get_v2raya_arch "$arch") local xray_file="$INSTALL_DIR/xray_${XRAY_VERSION}_${arch}.deb" - local v2raya_file="$INSTALL_DIR/v2raya_${V2RAYA_VERSION}_${arch}.deb" + local v2raya_file="$INSTALL_DIR/v2raya_${v2raya_arch}_${V2RAYA_VERSION}.deb" print_warning "即将卸载 V2rayA 和 Xray" read -p "是否继续?[y/N] " -n 1 -r @@ -332,8 +345,9 @@ uninstall_v2raya() { # 清理下载的安装包 clean_packages() { local arch=$(detect_arch) + local v2raya_arch=$(get_v2raya_arch "$arch") local xray_file="$INSTALL_DIR/xray_${XRAY_VERSION}_${arch}.deb" - local v2raya_file="$INSTALL_DIR/v2raya_${V2RAYA_VERSION}_${arch}.deb" + local v2raya_file="$INSTALL_DIR/v2raya_${v2raya_arch}_${V2RAYA_VERSION}.deb" local files_found=0 print_warning "即将删除下载的安装包" @@ -384,8 +398,9 @@ clean_packages() { # 检查安装状态 check_status() { local arch=$(detect_arch) + local v2raya_arch=$(get_v2raya_arch "$arch") local xray_file="$INSTALL_DIR/xray_${XRAY_VERSION}_${arch}.deb" - local v2raya_file="$INSTALL_DIR/v2raya_${V2RAYA_VERSION}_${arch}.deb" + local v2raya_file="$INSTALL_DIR/v2raya_${v2raya_arch}_${V2RAYA_VERSION}.deb" echo "" print_info "============================================"