diff --git a/net/nut/Makefile b/net/nut/Makefile index 320b496de6db5..24fb4f681241f 100644 --- a/net/nut/Makefile +++ b/net/nut/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nut PKG_VERSION:=2.8.4 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.networkupstools.org/source/2.8/ diff --git a/net/nut/files/nut-server.init b/net/nut/files/nut-server.init index 70cb21f8713eb..240464de045b0 100755 --- a/net/nut/files/nut-server.init +++ b/net/nut/files/nut-server.init @@ -195,22 +195,27 @@ build_driver_config() { config_list_foreach "$cfg" override defoverride override config_list_foreach "$cfg" default defoverride default - other() { + do_other() { local othervar="$1" local othervarflag="$2" local otherval if [ "$othervarflag" = "otherflag" ]; then - config_get_bool otherval "${othervarflag}_${othervar}" value + config_get_bool otherval "${cfg}" "${othervarflag}_${othervar}" value [ "$otherval" = "1" ] && echo "${othervar}" >>"$UPS_C" else - config_get otherval "${othervarflag}_${othervar}" value + config_get otherval "${cfg}" "${othervarflag}_${othervar}" value [ -n "$otherval" ] && echo "${othervar} = $otherval" >>"$UPS_C" fi } - config_list_foreach "$cfg" other other other - config_list_foreach "$cfg" otherflag other otherflag + # For each entry in the list "other", get the variable "other_${entry}", + # and if not empty, write "${entry} = ${value of other_${entry}}" to the config file. + config_list_foreach "$cfg" other do_other other + + # For each entry in the list "otherflag", get the variable "otherflag_${entry}", + # and if true, write "${entry}" to the config file. + config_list_foreach "$cfg" otherflag do_other otherflag echo "" >>$UPS_C havedriver=1 }