1、下载二进制文件
- 下载地址:https://github.com/c0re100/qBittorrent-Enhanced-Edition/releases
- 选择适合自己系统的版本
mkdir /root/docker/qb && cd /root/docker/qb
wget https://github.com/c0re100/qBittorrent-Enhanced-Edition/releases/download/release-4.6.3.10/qbittorrent-enhanced-nox_x86_64-linux-musl_static.zip
如果你拉取不了压缩包,可以使用如下命令
wget https://git.smartapi.com.cn/https://github.com/c0re100/qBittorrent-Enhanced-Edition/releases/download/release-4.6.3.10/qbittorrent-enhanced-nox_x86_64-linux-musl_static.zip
2、启动qbittorrent-nox
./qbittorrent-nox -d
但是这样启动必须每次手动启动qb,且容易后台掉线
3、开机启动qbittorrent
- 进入 /etc/init.d 目录,并创建脚本
#!/bin/sh
case $1 in
start)
if pgrep -f "qbittorrent-nox" > /dev/null; then
echo "qBittorrent is already running"
else
echo "Starting qBittorrent..."
cd /root/docker/qb ##替换为qb的安装目录
./qbittorrent-nox & ##启动命令
fi
;;
stop)
echo "Stopping qBittorrent..."
killall qbittorrent-nox
;;
restart)
$0 stop
$0 start
;;
status)
if pgrep -f "qbittorrent-nox" > /dev/null; then
echo "qBittorrent is running"
else
echo "qBittorrent is not running"
fi
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
exit 0
- 创建软链接
ln -s /etc/init.d/qbittorrent /etc/rc.d/S99qbittorrent
- 服务启动/关闭/重启/状态
/etc/init.d/qbittorrent start|stop|restart|status
以下是响应示例
root@iStoreOS:~# /etc/init.d/qbittorrent status
qBittorrent is running
root@iStoreOS:~# /etc/init.d/qbittorrent start
qBittorrent is already running
- 如果不能自动启动的话,还可以在rc.local文件中添加指令
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
/etc/init.d/qbittorrent start
exit 0
评论区