transmission: Allow user to configure web ui home directory

Signed-off-by: Andrii Korzh <andrii.korzh@gmail.com>
(cherry-picked from 582f697afd)
This commit is contained in:
Andrii Korzh 2018-07-12 15:40:07 +03:00 committed by Rosen Penev
parent cdc0017367
commit b5957aed64
No known key found for this signature in database
GPG key ID: 36D31CFA845F0E3B
3 changed files with 8 additions and 1 deletions

View file

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=transmission
PKG_VERSION:=2.94
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GITHUB/transmission/transmission-releases/master

View file

@ -6,6 +6,7 @@ config transmission
option group 'transmission'
option mem_percentage 50
option nice 10
option web_home ''
option alt_speed_down 50
option alt_speed_enabled false
option alt_speed_time_begin 540

View file

@ -52,6 +52,7 @@ transmission() {
local mem_percentage
local nice
local cmdline
local web_home
section_enabled "$section" || return 1
@ -62,6 +63,7 @@ transmission() {
config_get mem_percentage "$cfg" 'mem_percentage' '50'
config_get config_overwrite "$cfg" config_overwrite 1
config_get nice "$cfg" nice 0
config_get web_home "$cfg" 'web_home'
local MEM=$(sed -ne 's!^MemTotal:[[:space:]]*\([0-9]*\) kB$!\1!p' /proc/meminfo)
if test "$MEM" -gt 1;then
@ -123,6 +125,10 @@ transmission() {
logger -t transmission "Starting with $USE virt mem"
fi
if test -d "$web_home"; then
procd_set_param env TRANSMISSION_WEB_HOME="$web_home"
fi
procd_add_jail transmission log
procd_add_jail_mount $config_file
procd_add_jail_mount_rw $download_dir