mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
nut: Use diff non-privileged user for upsmon
By default use a non-privileged user that is different than the server or driver (when they are running non-privileged). This is recommended by upstream. Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
This commit is contained in:
@@ -6,11 +6,13 @@ UPSMON_C=/var/etc/nut/upsmon.conf
|
||||
|
||||
nut_upsmon_conf() {
|
||||
local cfg="$1"
|
||||
local RUNAS val optval
|
||||
|
||||
echo "# Config file automatically generated from UCI config" > $UPSMON_C
|
||||
|
||||
config_get runas "$cfg" runas "nut"
|
||||
[ -n "$runas" ] && echo "RUN_AS_USER $runas" >> $UPSMON_C
|
||||
config_get RUNAS "$cfg" runas "nutmon"
|
||||
[ -n "$RUNAS" ] && echo "RUN_AS_USER $RUNAS" >> "$UPSMON_C"
|
||||
runas=$RUNAS
|
||||
|
||||
config_get val "$cfg" minsupplies 1
|
||||
echo "MINSUPPLIES $val" >> $UPSMON_C
|
||||
|
||||
Reference in New Issue
Block a user