treewide: use config_get_bool instead of config_get enabled
authorSergey Ponomarev <stokito@gmail.com>
Sat, 11 May 2024 07:30:21 +0000 (10:30 +0300)
committerTianling Shen <cnsztl@gmail.com>
Sat, 25 May 2024 19:00:50 +0000 (03:00 +0800)
The config_get_bool function parses not just the 1 but on/yes, true/false or enabled/disabled.

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
17 files changed:
net/atftp/Makefile
net/atftp/files/atftpd.init
net/dcwapd/Makefile
net/dcwapd/files/dcwapd.init
net/dnsproxy/Makefile
net/dnsproxy/files/dnsproxy.init
net/hs20/Makefile
net/hs20/files/hs20.init
net/mwan3/Makefile
net/mwan3/files/lib/mwan3/mwan3.sh
net/mwan3/files/usr/libexec/rpcd/mwan3
net/natmap/Makefile
net/natmap/files/natmap.init
net/respondd/Makefile
net/respondd/files/respondd.init
utils/collectd/Makefile
utils/collectd/files/collectd.init

index b85e520a1e7d8c903d696c89fbf61e3d6966a67f..c7cf408812b8aed86c3e716315c41a0a44fec799 100644 (file)
@@ -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)
index 03627eeb37823616d035d36db26a118d72b290ba..502ccbe192ee4552f85d4ec199b785b900de7a0c 100755 (executable)
@@ -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"
index f33e5a89b3516d70e661cfb28b45da825e781e6a..049fdb68a19c3da427d71c8f14457c2f51423f09 100644 (file)
@@ -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)?
index ad28a0b0d4ad810a8c6e994e158e552850587699..3928d3fe788d50ccf95a8ce270ec1feee08e3569 100644 (file)
@@ -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
index 8a97ac28710b7f7a7ab096bf61d9779a8d82bd43..3ceae64887f33376975bde0499a4ddca67723a95 100644 (file)
@@ -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)?
index ab1382d3f1f07e7e702fa6f4e9aaf86d9159c8c1..f39038c37e234440336645dc1e8adb71a995e02d 100644 (file)
@@ -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
index ffa4a4765f782682d065da02e645a67e6dce659b..17a0e37db8198e9d2691ef1ea56abd53f385aa58 100644 (file)
@@ -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
index c23fcf807200d69ef4bb10d2eff4590a44aace48..d0d5d5d86941ab32e808c01a0b5330856c636c57 100644 (file)
@@ -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"
index 3d4dd36a14fc412df5a62909a8529751608b37f6..9743edcb92e714dd25f17c399f595dc047742fc3 100644 (file)
@@ -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 <fe@dev.tdt.de>, \
                Aaron Goodman <aaronjg@alumni.stanford.edu>
 PKG_LICENSE:=GPL-2.0
index c69f381ea851345e5182e85cd741e0eacee8e3e0..5376b885ff6baac38e6ba3c1b4186f6f02cd8105 100644 (file)
@@ -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
index 4bd2b631f6263bdcb2ca814fa6c29cc6d6db076c..210e79a6d8df53d42d244a71216d6a9feb75c240 100755 (executable)
@@ -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"
index 47809d46e19234b714a6be1d45c2610c69eec9dd..5a94f11fd7563b366ce610cac71c6319cad5e334 100644 (file)
@@ -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)
index bfead56f93181e0c276cfa565b797238a46409b4..fb7323f87c676d739402bfbc2ba22950d1ce5119 100644 (file)
@@ -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}"
 }
index b748a1af5dbaa6cfad5d9f5c8ca25ada17289ce9..d852954b8523de666e028cc0707bb93a5985197d 100644 (file)
@@ -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
index b17e4b5cb449629022af45f2e620a036c17264ec..f45a9ce942f983db083a658fcf73d788f3825ee7 100644 (file)
@@ -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
index 76a22cbe98b7692f5940038d6e5b525e03abb71e..a58b81d1758624934ecaebcf9aac2506a82a8080 100644 (file)
@@ -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/ \
index 2146a668659d08630604bf022398bfecee4c4463..50c329bb1159c1a5370ca3524039b6e6bf9bd9ba 100644 (file)
@@ -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" ] || {