Browse Source

transmission: add mount trigger

Restart transmission once an underlaying mountpoint becomes available.
Add myself as maintainer.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
lilik-openwrt-22.03
Daniel Golle 3 years ago
parent
commit
847b17651a
No known key found for this signature in database GPG Key ID: 5A8F39C31C3217CA
2 changed files with 29 additions and 2 deletions
  1. +2
    -1
      net/transmission/Makefile
  2. +27
    -1
      net/transmission/files/transmission.init

+ 2
- 1
net/transmission/Makefile View File

@ -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 <daniel@makrotopia.org>
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:transmissionbt:transmission


+ 27
- 1
net/transmission/files/transmission.init View File

@ -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'
}

Loading…
Cancel
Save