Skip to content

Commit

Permalink
fty-nutconfig: Fix removing the last device
Browse files Browse the repository at this point in the history
An empty configuration directory is still a valid configuration, proceed
with generating an empty ups.conf instead of leaving the previous
devices around.
  • Loading branch information
michal42 committed Jul 4, 2018
1 parent abe44c0 commit 41612fc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fty-nutconfig
Expand Up @@ -25,6 +25,7 @@
# from files stored in /var/lib/fty/fty-nut/devices.

set -e
shopt -s nullglob

export PATH=/bin:/usr/bin
export LC_ALL=C
Expand Down Expand Up @@ -57,7 +58,7 @@ EOF
RES=$?

if [ "$RES" = 0 ]; then
cat "${BIOSCONFDIR}"/* 2> /dev/null >> "${TMPFILE}" || RES=$?
cat "${BIOSCONFDIR}"/* /dev/null 2> /dev/null >> "${TMPFILE}" || RES=$?
fi

if [ "$RES" = 0 ] && [ ! -s /etc/systemd/system/nut-driver@.service.d/timeout.conf ] ; then
Expand Down

0 comments on commit 41612fc

Please sign in to comment.