nut: Fix bad check for conf exists

We were `cat`ing the file instead of just checking for non-empty
existance.  Fix that.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
This commit is contained in:
Daniel F. Dickinson 2019-08-26 23:48:49 -04:00
parent c963f0c297
commit ccdec71b5c

View file

@ -153,7 +153,7 @@ build_config() {
config_foreach nut_upsmon_add master master
config_foreach nut_upsmon_add slave slave
[ ! -s "$(cat /var/etc/nut/nut.conf)" ] && {
[ ! -s /var/etc/nut/nut.conf ] && {
echo "MODE=netclient" >>/var/etc/nut/nut.conf
chmod 640 /var/etc/nut/nut.conf
chgrp $(id -gn ${runas:-root}) /var/etc/nut/nut.conf