nut: Fix bad check for conf exists
authorDaniel F. Dickinson <cshored@thecshore.com>
Tue, 27 Aug 2019 03:48:49 +0000 (23:48 -0400)
committerDaniel F. Dickinson <cshored@thecshore.com>
Tue, 27 Aug 2019 03:48:49 +0000 (23:48 -0400)
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>
net/nut/files/nut-monitor.init

index 1e3ab2930f9fc3456e796c0dc2e075bdefd1be8c..72458f21a920194390a946b4b3fd0c1fe268caa4 100755 (executable)
@@ -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