From cbfbb655320ad898e79cafd8983ae086130bf50b Mon Sep 17 00:00:00 2001 From: Salim B Date: Sun, 12 Feb 2023 22:20:00 +0100 Subject: [PATCH] transmission: retrieve boolean config opts using `config_get_bool` The tranmission UCI config options - `config_overwrite` - `incomplete_dir_enabled` - `watch_dir_enabled` are all booleans, so we have to retrieve them using `config_get_bool` in order to make sure they are properly interpreted in case the user sets them to a keyword (`true`/`false`, `on`/`off` etc.) and not an integer (`0`/`1`). Signed-off-by: Salim B (cherry picked from commit 63dc13d7d2f5150bf3cf4b6648d8c7f10975381f) --- net/transmission/files/transmission.init | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/transmission/files/transmission.init b/net/transmission/files/transmission.init index 0e6e043d9b..a6bc00f01b 100644 --- a/net/transmission/files/transmission.init +++ b/net/transmission/files/transmission.init @@ -58,15 +58,15 @@ transmission() { local incomplete_dir config_get incomplete_dir "$cfg" 'incomplete_dir' '/var/etc/transmission' local incomplete_dir_enabled - config_get incomplete_dir_enabled "$cfg" 'incomplete_dir_enabled' 0 + config_get_bool incomplete_dir_enabled "$cfg" 'incomplete_dir_enabled' 0 local watch_dir config_get watch_dir "$cfg" 'watch_dir' '/var/etc/transmission' local watch_dir_enabled - config_get watch_dir_enabled "$cfg" 'watch_dir_enabled' 0 + config_get_bool watch_dir_enabled "$cfg" 'watch_dir_enabled' 0 local mem_percentage config_get mem_percentage "$cfg" 'mem_percentage' '50' local config_overwrite - config_get config_overwrite "$cfg" config_overwrite 1 + config_get_bool config_overwrite "$cfg" config_overwrite 1 local nice config_get nice "$cfg" nice 0 local web_home @@ -196,9 +196,9 @@ transmission_mount_triggers() { 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_bool 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_bool 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' -- 2.30.2