nut: fix _ handling
authorRosen Penev <rosenp@gmail.com>
Sat, 19 Sep 2020 23:52:58 +0000 (16:52 -0700)
committerRosen Penev <rosenp@gmail.com>
Sat, 19 Sep 2020 23:52:58 +0000 (16:52 -0700)
Taken from https://github.com/openwrt/packages/issues/13359

Signed-off-by: Rosen Penev <rosenp@gmail.com>
net/nut/Makefile
net/nut/files/nut-server.init

index f62ec8519ef570b1ac303ed2b22d62bf6cf05d15..c699fe260aec50b2f013351aa1edb0a690881159 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nut
 PKG_VERSION:=2.7.4
-PKG_RELEASE:=20
+PKG_RELEASE:=21
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.networkupstools.org/source/2.7/
index a03d6b9cf802c98fc3567df237fe6399ae873c00..7d550bda08b0536ffa23f8d7b5ea710d4cfa0439 100755 (executable)
@@ -179,11 +179,11 @@ build_driver_config() {
        defoverride() {
                local overvar="$1"
                local defover="$2"
-               local overtype="$(echo "$overvar" | tr '.' '_')"
+               local overtype="$(echo "$overvar" | tr '_' '.')"
                local overval
 
-               config_get overval "${defover}_${overtype}" value
-               [ -n "$overval" ] && echo "${defover}.${overvar} = $overval" >>"$UPS_C"
+               config_get overval "${defover}_${overvar}" value
+               [ -n "$overval" ] && echo "${defover}.${overtype} = $overval" >>"$UPS_C"
        }
 
        config_list_foreach "$cfg" override defoverride override