Miracle - Qbittorrent-nox
type: channel
link: https://www.tofzl.com/index.php/tag/Qbittorrent-nox/
items: IP变更自动重启qb脚本
items: Qbittorrent-nox的安装，开机启动和常用命令

IP变更自动重启qb脚本
type: item
date: 2025-04-03T21:43:00+08:00
description: 由于IP为动态，每次IP变化qb的端口需要重启才能通#!/bin/bash # 设置错误立即退出（避免部分失败仍继续执行） set -e # 检查端口状态 port=$(nmap -p 62333 $(curl -6s ipv6.ip.sb) -6 | grep '/tcp' | awk '{print $2}') echo "[$(date)] qBittorrent 端口状态为：$port" # 判断是否需要重启 if [[ "$port" == "open" ]]; then echo "[$(date)] 端口开放，无需重启" else echo "[$(date)] 端口关闭，正在重启 qBittorrent..." systemctl restart qb fi 添加执行权限：chmod +x /root/restartqb.sh添加定时：crontab -e*/10 * * * * /root/restartqb.sh >> /var/log/qb_check.log 2>&1

Qbittorrent-nox的安装，开机启动和常用命令
type: item
date: 2021-11-21T15:55:00+08:00
description: 1.安装项目地址：https://github.com/Aniverse/qbittorrent-nox-static安装命令：bash <(wget -qO- --no-check-certificate https://github.com/Aniverse/qbittorrent-nox-static/raw/master/install.sh) \ -u <username> -p <webui password> -w <webui port> -v <version>例如bash <(curl -Ls https://github.com/Aniverse/qbittorrent-nox-static/raw/master/install.sh) -u aaa -p 123456 \ -w 8080 -v 4.2.5.lt.1.2.10安装完成后放行指定的端口，然后访问设置好Qbittorrent。2.开机启动在电脑上新建文本文档，复制如下内容：[Unit] Description=qBittorrent-nox After=network.target [Service] User=root Type=forking RemainAfterExit=yes ExecStart=/usr/bin/qbittorrent-nox -d [Install] WantedBy=multi-user.target 然后保存为qbittorrent-nox.service，通过Finalshell，把此文件上传到/etc/systemd/system文件夹下，最后设置开机自启。开机自启命令：systemctl enable qbittorrent-nox3.常用命令启动Qbittorrent：qbittorrent-nox在后台启动Qbittorrent：qbittorrent-nox -d查看Qbittorrent版本：qbittorrent-nox -v启动 Qbittorrent 并指定 Web 面板的端口:qbittorrent-nox --webui-port=xxxx查看帮助：qbittorrent-nox -h