From 582f697afd3fece189139ed3583441a867914ac5 Mon Sep 17 00:00:00 2001 From: Andrii Korzh Date: Thu, 12 Jul 2018 15:40:07 +0300 Subject: [PATCH] transmission: Allow user to configure web ui home directory Signed-off-by: Andrii Korzh --- net/transmission/Makefile | 2 +- net/transmission/files/transmission.config | 1 + net/transmission/files/transmission.init | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/net/transmission/Makefile b/net/transmission/Makefile index 7e05f75e9..6dfd4b32e 100644 --- a/net/transmission/Makefile +++ b/net/transmission/Makefile @@ -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 diff --git a/net/transmission/files/transmission.config b/net/transmission/files/transmission.config index 0dad95042..770908c7f 100644 --- a/net/transmission/files/transmission.config +++ b/net/transmission/files/transmission.config @@ -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 diff --git a/net/transmission/files/transmission.init b/net/transmission/files/transmission.init index c7593ac1d..521fe20b8 100644 --- a/net/transmission/files/transmission.init +++ b/net/transmission/files/transmission.init @@ -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