Ubuntu安装qBittorrentwebui(qbittorrent-nox)添加源sudoadd-apt-repository ppa:qbittorrent-team/qbittorrent-stable安装成功添加源后,更新包的信息,再安装qBitto rrentwebui:sudoapt-getupdatesudoapt-getinstallqbittorrent-n ox启动成功安装后,输入以下命令启动软件:qbittorrent-nox启动后,在浏览器中输入http://ip地址:8080, 即可打开qBittorrent的网页端。默认的用户名是admin,默认密码为adminadmin。如果要使用其他端口,只需在启 动命令中加入--webui-port=XXXX参数,其中XXXX为端口号:qbittorrent-nox--webui-port =XXXX设置开机自启动输入vi/etc/init.d/qbittorrent-nox-daemon,添加以下内容:#!/bi n/sh###BEGININITINFO#Provides:qbittorrent-nox#Requ ired-Start:$remote_fs$syslog#Required-Stop:$remote_fs $syslog#Default-Start:2345#Default-Stop:016#Sh ort-Description:StartsQBittorrent#Description:Startqbi ttorrent-noxonstart.ChangeUSER=beforerunning###ENDINITIN FO#Author:JesperSmith##DoNOT"set-e"#PATHshouldonlyincl ude/usr/ifitrunsafterthemountnfs.shscriptPATH=/sbin:/usr /sbin:/bin:/usr/binDESC="QBittorrent"NAME=qbittorrent-noxDAEMON=/ usr/bin/$NAMEDAEMON_ARGS=""PIDFILE=/var/run/$NAME.pidSCRIPTNAME=/ etc/init.d/qbittorrentUSER=[USERNAME]#Exitifthepackageisnot installed[-x"$DAEMON"]||exit0#Readconfigurationvariable fileifitispresent[-r/etc/default/$NAME]&&./etc/default /$NAME#LoadtheVERBOSEsettingandotherrcSvariables./lib/in it/vars.sh#DefineLSBlog_functions.#Dependonlsb-base(>=3 .0-6)toensurethatthisfileispresent../lib/lsb/init-functio ns##Functionthatstartsthedaemon/service#do_start(){#Return #0ifdaemonhasbeenstarted#1ifdaemonwasalreadyrun ning#2ifdaemoncouldnotbestartedstart-stop-daemon-c$U SER-b-t--start--quiet--exec$DAEMON\||return1start-st op-daemon-c$USER-b--start--quiet--exec$DAEMON--\$DAEMON _ARGS\||return2sleep1}##Functionthatstopsthedaemon/ser vice#do_stop(){start-stop-daemon-c$USER--quiet--stop--exec $DAEMONsleep2return"$?"}case"$1"instart)["$VERBOSE"!= no]&&log_daemon_msg"Starting$DESC""$NAME"do_startcase"$? "in0|1)["$VERBOSE"!=no]&&log_end_msg0;;2)["$VERBOSE "!=no]&&log_end_msg1;;esac;;stop)["$VERBOSE"!=no] &&log_daemon_msg"Stopping$DESC""$NAME"do_stopcase"$?"in0 |1)["$VERBOSE"!=no]&&log_end_msg0;;2)["$VERBOSE"!=n o]&&log_end_msg1;;esac;;status)status_of_proc"$DAEMON" "$NAME"&&exit0||exit$?;;restart|force-reload)log_daemon_ msg"Restarting$DESC""$NAME"do_stopcase"$?"in0|1)do_start case"$?"in0)log_end_msg0;;1)log_end_msg1;;#Oldproce ssisstillrunning)log_end_msg1;;#Failedtostartesac;; )#Failedtostoplog_end_msg1;;esac;;)#echo"Usage:$S CRIPTNAME{start|stop|restart|reload|force-reload}">&2echo"Usa ge:$SCRIPTNAME{start|stop|status|restart|force-reload}">&2exi t3;;esac其中,要把USER=MyUserName的MyUserName改为用户名,在DAEMON_ARGS="--we bui-port=XXXX"中把XXXX改为开启的端口号。保存并退出,修改文件的权限:sudochmod755/etc/in it.d/qbittorrent-nox-daemon再执行以下命令:sudoupdate-rc.dqbittorrent-n ox-daemondefaults下一次开机时会自动启动qbittorent。如果要手动开启、停止和重启,参考以下命令:sud oserviceqbittorrent-nox-daemonstartsudoserviceqbittorrent-nox-daemonstopsudoserviceqbittorrent-nox-daemonrestart配置QBittorrentwebui的配置文件qBittorrent.conf在~/.config/qBittorrent/文件夹中。 |
|