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