From: Daniel Golle Date: Sun, 8 Aug 2021 14:47:52 +0000 (+0100) Subject: transmission: add mount trigger X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=847b17651a7bf4223e2afcaa5b3db427b2cf3b66;p=feed%2Fpackages.git transmission: add mount trigger Restart transmission once an underlaying mountpoint becomes available. Add myself as maintainer. Signed-off-by: Daniel Golle --- diff --git a/net/transmission/Makefile b/net/transmission/Makefile index 14b4daf2f3..7926486a88 100644 --- a/net/transmission/Makefile +++ b/net/transmission/Makefile @@ -9,12 +9,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=transmission PKG_VERSION:=3.00 -PKG_RELEASE:=13 +PKG_RELEASE:=14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GITHUB/transmission/transmission-releases/master PKG_HASH:=9144652fe742f7f7dd6657716e378da60b751aaeda8bef8344b3eefc4db255f2 +PKG_MAINTAINER:=Daniel Golle PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE_FILES:=COPYING PKG_CPE_ID:=cpe:/a:transmissionbt:transmission diff --git a/net/transmission/files/transmission.init b/net/transmission/files/transmission.init index 2421572772..3c4c7d805d 100644 --- a/net/transmission/files/transmission.init +++ b/net/transmission/files/transmission.init @@ -173,6 +173,32 @@ reload_service() { procd_send_signal "$PROG" } +transmission_mount_triggers() { + local cfg="$1" + + local enabled + config_get_bool enabled "$cfg" enabled 0 + [ "$enabled" -gt 0 ] || return 0 + + local config_dir download_dir incomplete_dir incomplete_dir_enabled \ + watch_dir watch_dir_enabled web_home service_dirs + config_get config_dir "$cfg" 'config_dir' '/var/etc/transmission' + config_get download_dir "$cfg" 'download_dir' '/var/etc/transmission' + config_get incomplete_dir_enabled "$cfg" 'incomplete_dir_enabled' 0 + config_get incomplete_dir "$cfg" 'incomplete_dir' '/var/etc/transmission' + config_get watch_dir_enabled "$cfg" 'watch_dir_enabled' 0 + config_get watch_dir "$cfg" 'watch_dir' '/var/etc/transmission' + config_get web_home "$cfg" 'web_home' + + service_dirs="$config_dir $download_dir $web_home" + [ "$incomplete_dir_enabled" = "0" ] || service_dirs="$service_dirs $incomplete_dir" + [ "$watch_dir_enabled" = "0" ] || service_dirs="$service_dirs $watch_dir" + + procd_add_restart_mount_trigger $service_dirs +} + service_triggers() { - procd_add_reload_trigger "transmission" + procd_add_reload_trigger 'transmission' + config_load 'transmission' + config_foreach transmission_mount_triggers 'transmission' }