Skip to content

Commit f8ecd52

Browse files
authored
Merge pull request #3164 from atanas-vladimirov/master
upsset.c: Recognize RANGE NUMBER and NUMBER types.
2 parents 3b065ee + 6864b38 commit f8ecd52

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

NEWS.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ NOTE: If using `upssched` and monitoring multiple UPSes, consider setting up
191191
a `START-TIMER-SHARED` rule with a short (approx. 1 second) timeout to group
192192
several `FSD` notifications into one executed action. [PR #3097]
193193

194+
- `upsset` should now recognize `RANGE NUMBER` and `NUMBER` types. [#3164]
195+
194196
- `upssched` tool updates:
195197
* Previously in PR #2896 (NUT releases v2.8.3 and v2.8.4) the `UPSNAME` and
196198
`NOTIFYTYPE` environment variables were neutered for the timer daemon,

clients/upsset.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,19 @@ static void do_type(const char *varname)
770770
return;
771771
}
772772

773+
if (!strcasecmp(answer[i], "NUMBER")) {
774+
/* 20 is a reasonable default size for the text box */
775+
do_string(varname, 20);
776+
return;
777+
}
778+
779+
/* RANGE is usually paired with NUMBER.
780+
We can ignore 'RANGE' and let the 'NUMBER'
781+
case (which should come next) handle it. */
782+
if (!strcasecmp(answer[i], "RANGE")) {
783+
continue;
784+
}
785+
773786
/* ignore this one */
774787
if (!strcasecmp(answer[i], "RW"))
775788
continue;

0 commit comments

Comments
 (0)