[type/__uci] Send messages when options are set to be altered

This commit is contained in:
Dennis Camera 2020-06-20 16:43:16 +02:00
parent d8f20a6a20
commit d3574b2d3e

View file

@ -53,6 +53,8 @@ in
if test "$(wc -l "${__object:?}/parameter/value")" -gt 1
then
# "should" is a list
printf 'set_list %s\n' "${config}" >>"${__messages_out:?}"
if test "${state_is}" != 'absent'
then
printf "uci delete '%s'\n" "${config}"
@ -64,6 +66,8 @@ in
done <"${__object:?}/parameter/value"
else
# "should" is a scalar
printf 'set %s\n' "${config}" >>"${__messages_out:?}"
value=$(cat "${__object:?}/parameter/value")
uci_cmd "set '%s'='%s'" "${config}" "${value}"
fi
@ -74,6 +78,7 @@ in
exit 0
fi
printf 'delete %s\n' "${config}" >>"${__messages_out:?}"
uci_cmd "delete '%s'" "${config}"
;;
(*)