@@ -38,25 +38,33 @@ if [ ! -f "$qbtConfigFile" ]; then
3838Session\DefaultSavePath=$downloadsPath
3939Session\Port=6881
4040Session\TempPath=$downloadsPath /temp
41+ [Preferences]
42+ WebUI\Port=8080
4143EOF
4244fi
4345
44- confirmLegalNotice =" "
46+ argLegalNotice =" "
4547_legalNotice=$( echo " $QBT_LEGAL_NOTICE " | tr -d ' [:space:]' | tr ' [:upper:]' ' [:lower:]' )
4648if [ " $_legalNotice " = " confirm" ]; then
47- confirmLegalNotice =" --confirm-legal-notice"
49+ argLegalNotice =" --confirm-legal-notice"
4850else
4951 # for backward compatibility
5052 # TODO: remove in next major version release
5153 _eula=$( echo " $QBT_EULA " | tr -d ' [:space:]' | tr ' [:upper:]' ' [:lower:]' )
5254 if [ " $_eula " = " accept" ]; then
5355 echo " QBT_EULA=accept is deprecated and will be removed soon. The replacement is QBT_LEGAL_NOTICE=confirm"
54- confirmLegalNotice =" --confirm-legal-notice"
56+ argLegalNotice =" --confirm-legal-notice"
5557 fi
5658fi
5759
58- if [ -z " $QBT_WEBUI_PORT " ]; then
59- QBT_WEBUI_PORT=8080
60+ argTorrentingPort=" "
61+ if [ -n " $QBT_TORRENTING_PORT " ]; then
62+ argTorrentingPort=" --torrenting-port=$QBT_TORRENTING_PORT "
63+ fi
64+
65+ argWebUIPort=" "
66+ if [ -n " $QBT_WEBUI_PORT " ]; then
67+ argWebUIPort=" --webui-port=$QBT_WEBUI_PORT "
6068fi
6169
6270if [ " $isRoot " = " 1" ]; then
@@ -79,15 +87,17 @@ if [ "$isRoot" = "1" ]; then
7987 exec \
8088 doas -u qbtUser \
8189 qbittorrent-nox \
82- " $confirmLegalNotice " \
90+ " $argLegalNotice " \
8391 --profile=" $profilePath " \
84- --webui-port=" $QBT_WEBUI_PORT " \
92+ " $argTorrentingPort " \
93+ " $argWebUIPort " \
8594 " $@ "
8695else
8796 exec \
8897 qbittorrent-nox \
89- " $confirmLegalNotice " \
98+ " $argLegalNotice " \
9099 --profile=" $profilePath " \
91- --webui-port=" $QBT_WEBUI_PORT " \
100+ " $argTorrentingPort " \
101+ " $argWebUIPort " \
92102 " $@ "
93103fi
0 commit comments