From 4c4a7bd31da51e3040a5da55c504c5e97ac150e4 Mon Sep 17 00:00:00 2001 From: Sergey Ponomarev Date: Sat, 11 May 2024 10:30:21 +0300 Subject: [PATCH] treewide: use config_get_bool instead of config_get enabled The config_get_bool function parses not just the 1 but on/yes, true/false or enabled/disabled. Signed-off-by: Sergey Ponomarev --- net/atftp/Makefile | 2 +- net/atftp/files/atftpd.init | 2 +- net/dcwapd/Makefile | 2 +- net/dcwapd/files/dcwapd.init | 2 +- net/dnsproxy/Makefile | 2 +- net/dnsproxy/files/dnsproxy.init | 2 +- net/hs20/Makefile | 2 +- net/hs20/files/hs20.init | 2 +- net/mwan3/Makefile | 2 +- net/mwan3/files/lib/mwan3/mwan3.sh | 4 ++-- net/mwan3/files/usr/libexec/rpcd/mwan3 | 2 +- net/natmap/Makefile | 2 +- net/natmap/files/natmap.init | 2 +- net/respondd/Makefile | 2 +- net/respondd/files/respondd.init | 2 +- utils/collectd/Makefile | 2 +- utils/collectd/files/collectd.init | 2 +- 17 files changed, 18 insertions(+), 18 deletions(-) diff --git a/net/atftp/Makefile b/net/atftp/Makefile index b85e520a1e..c7cf408812 100644 --- a/net/atftp/Makefile +++ b/net/atftp/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=atftp PKG_VERSION:=0.8.0 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SF/$(PKG_NAME) diff --git a/net/atftp/files/atftpd.init b/net/atftp/files/atftpd.init index 03627eeb37..502ccbe192 100755 --- a/net/atftp/files/atftpd.init +++ b/net/atftp/files/atftpd.init @@ -11,7 +11,7 @@ start() { config_load atftpd - config_get enable service enable 0 + config_get_bool enable service enable 0 [ "$enable" -eq "0" ] && return 0 config_get srv service path "/srv/tftp" diff --git a/net/dcwapd/Makefile b/net/dcwapd/Makefile index f33e5a89b3..049fdb68a1 100644 --- a/net/dcwapd/Makefile +++ b/net/dcwapd/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dcwapd PKG_VERSION:=1.1.0 -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/ewsi/$(PKG_NAME)/tar.gz/v$(PKG_VERSION)? diff --git a/net/dcwapd/files/dcwapd.init b/net/dcwapd/files/dcwapd.init index ad28a0b0d4..3928d3fe78 100644 --- a/net/dcwapd/files/dcwapd.init +++ b/net/dcwapd/files/dcwapd.init @@ -254,7 +254,7 @@ start_service() { config_load "$CONFIGURATION" local enabled - config_get enabled general enabled + config_get_bool enabled general enabled if [ "$enabled" != "1" ]; then echo "dcwapd is disabled in UCI" return 1 diff --git a/net/dnsproxy/Makefile b/net/dnsproxy/Makefile index 8a97ac2871..3ceae64887 100644 --- a/net/dnsproxy/Makefile +++ b/net/dnsproxy/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsproxy PKG_VERSION:=0.71.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/AdguardTeam/dnsproxy/tar.gz/v$(PKG_VERSION)? diff --git a/net/dnsproxy/files/dnsproxy.init b/net/dnsproxy/files/dnsproxy.init index ab1382d3f1..f39038c37e 100644 --- a/net/dnsproxy/files/dnsproxy.init +++ b/net/dnsproxy/files/dnsproxy.init @@ -9,7 +9,7 @@ PROG="/usr/bin/dnsproxy" is_enabled() { local enabled - config_get enabled "$1" "$2" "0" + config_get_bool enabled "$1" "$2" "0" if [ "$enabled" -eq "1" ]; then return 0 else diff --git a/net/hs20/Makefile b/net/hs20/Makefile index ffa4a4765f..17a0e37db8 100644 --- a/net/hs20/Makefile +++ b/net/hs20/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hs20 -PKG_RELEASE:=9 +PKG_RELEASE:=10 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git diff --git a/net/hs20/files/hs20.init b/net/hs20/files/hs20.init index c23fcf8072..d0d5d5d869 100644 --- a/net/hs20/files/hs20.init +++ b/net/hs20/files/hs20.init @@ -170,7 +170,7 @@ EOF start_service() { local enabled config_load hs20 - config_get enabled server enabled + config_get_bool enabled server enabled [ "$enabled" != "1" ] && [ "$enabled" != "true" ] && exit 0 echo "starting" diff --git a/net/mwan3/Makefile b/net/mwan3/Makefile index 3d4dd36a14..9743edcb92 100644 --- a/net/mwan3/Makefile +++ b/net/mwan3/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mwan3 PKG_VERSION:=2.11.13 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_MAINTAINER:=Florian Eckert , \ Aaron Goodman PKG_LICENSE:=GPL-2.0 diff --git a/net/mwan3/files/lib/mwan3/mwan3.sh b/net/mwan3/files/lib/mwan3/mwan3.sh index c69f381ea8..5376b885ff 100644 --- a/net/mwan3/files/lib/mwan3/mwan3.sh +++ b/net/mwan3/files/lib/mwan3/mwan3.sh @@ -43,7 +43,7 @@ mwan3_update_dev_to_table() config_get family "$1" family ipv4 network_get_device device "$1" [ -z "$device" ] && return - config_get enabled "$1" enabled + config_get_bool enabled "$1" enabled [ "$enabled" -eq 0 ] && return curr_table=$(eval "echo \"\$mwan3_dev_tbl_${family}\"") export "mwan3_dev_tbl_$family=${curr_table}${device}=$_tid " @@ -1087,7 +1087,7 @@ mwan3_report_iface_status() mwan3_get_iface_id id "$1" network_get_device device "$1" - config_get enabled "$1" enabled 0 + config_get_bool enabled "$1" enabled 0 config_get family "$1" family ipv4 if [ "$family" = "ipv4" ]; then diff --git a/net/mwan3/files/usr/libexec/rpcd/mwan3 b/net/mwan3/files/usr/libexec/rpcd/mwan3 index 4bd2b631f6..210e79a6d8 100755 --- a/net/mwan3/files/usr/libexec/rpcd/mwan3 +++ b/net/mwan3/files/usr/libexec/rpcd/mwan3 @@ -104,7 +104,7 @@ get_mwan3_status() { online=$(get_online_time "$iface") offline=$(get_offline_time "$iface") - config_get enabled "$iface" enabled 0 + config_get_bool enabled "$iface" enabled 0 if [ -f "$MWAN3TRACK_STATUS_DIR/${iface}/STATUS" ]; then network_get_uptime uptime "$iface" diff --git a/net/natmap/Makefile b/net/natmap/Makefile index 47809d46e1..5a94f11fd7 100644 --- a/net/natmap/Makefile +++ b/net/natmap/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=natmap PKG_VERSION:=20240303 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/heiher/natmap/releases/download/$(PKG_VERSION) diff --git a/net/natmap/files/natmap.init b/net/natmap/files/natmap.init index bfead56f93..fb7323f87c 100644 --- a/net/natmap/files/natmap.init +++ b/net/natmap/files/natmap.init @@ -10,7 +10,7 @@ STATUS_PATH=/var/run/natmap load_interfaces() { config_get interface "$1" interface - config_get enable "$1" enable 1 + config_get_bool enable "$1" enable 1 [ "${enable}" = "1" ] && interfaces=" ${interface} ${interfaces}" } diff --git a/net/respondd/Makefile b/net/respondd/Makefile index b748a1af5d..d852954b85 100644 --- a/net/respondd/Makefile +++ b/net/respondd/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=respondd PKG_SOURCE_DATE:=2019-05-01 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/freifunk-gluon/respondd.git diff --git a/net/respondd/files/respondd.init b/net/respondd/files/respondd.init index b17e4b5cb4..f45a9ce942 100644 --- a/net/respondd/files/respondd.init +++ b/net/respondd/files/respondd.init @@ -11,7 +11,7 @@ multicast_group() { config_get group "$1" group config_get interfaces "$1" interface - config_get disabled "$1" disabled 0 + config_get_bool disabled "$1" disabled 0 if [ "$disabled" -gt "0" ]; then return diff --git a/utils/collectd/Makefile b/utils/collectd/Makefile index 76a22cbe98..a58b81d175 100644 --- a/utils/collectd/Makefile +++ b/utils/collectd/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=collectd PKG_VERSION:=5.12.0 -PKG_RELEASE:=50 +PKG_RELEASE:=51 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://collectd.org/files/ \ diff --git a/utils/collectd/files/collectd.init b/utils/collectd/files/collectd.init index 2146a66865..50c329bb11 100644 --- a/utils/collectd/files/collectd.init +++ b/utils/collectd/files/collectd.init @@ -466,7 +466,7 @@ process_plugins() { local enable keys key option value - config_get enable "$cfg" enable 0 + config_get_bool enable "$cfg" enable 0 [ "$enable" = "1" ] || return 0 [ -f "/usr/lib/collectd/$cfg.so" ] || { -- 2.30.2