From: Brian Flowers Date: Mon, 19 Sep 2016 17:18:56 +0000 (-0400) Subject: Bugfixes for last few commits X-Git-Url: http://git.slightlycyberpunk.com%2C%20git.slightlycyberpunk.com/git/?a=commitdiff_plain;h=efac74d61aa9201ce070f58f831cc539fe7c8369;p=bdsm.git Bugfixes for last few commits --- diff --git a/bdsm.d/df.generic b/bdsm.d/df.generic index 90cbe35..edcdea5 100755 --- a/bdsm.d/df.generic +++ b/bdsm.d/df.generic @@ -97,6 +97,9 @@ status() grep -v PID | \ wc -l"` + if [ -z "$running" ]; then + running=0 + fi if [ $running -eq 0 ]; then echo "OFF" else diff --git a/bdsm.d/sensors.generic b/bdsm.d/sensors.generic index 9d74a79..f9290d0 100755 --- a/bdsm.d/sensors.generic +++ b/bdsm.d/sensors.generic @@ -109,6 +109,9 @@ status() grep -v PID | \ wc -l"` + if [ -z "$running" ]; then + running=0 + fi if [ $running -eq 0 ]; then echo "OFF" else diff --git a/bdsm.d/vmstat.generic b/bdsm.d/vmstat.generic index 7af1e58..a3b1fbe 100755 --- a/bdsm.d/vmstat.generic +++ b/bdsm.d/vmstat.generic @@ -130,6 +130,9 @@ status() grep -v PID | \ wc -l"` + if [ -z "$running" ]; then + running=0 + fi if [ $running -eq 0 ]; then echo "OFF" else diff --git a/bdsm.sh b/bdsm.sh index 82d2f6f..6e3c637 100755 --- a/bdsm.sh +++ b/bdsm.sh @@ -179,7 +179,7 @@ start() j=0 - while read -U10 line; do + while read -u10 line; do command=`echo $line | cut -d' ' -f1` args="`echo $line | cut -d' ' -f2-`" if [ -f /home/bdsm/bdsm.d/$command.$type ]; then @@ -236,6 +236,9 @@ status() j=0 while read -u10 line; do command=`echo $line | cut -d' ' -f1` + if [ "$command" == "" ]; then + continue + fi prefix="$type:$host|$command|" if [ -f /home/bdsm/bdsm.d/$command.$type ]; then /home/bdsm/bdsm.d/$command.$type status $host | sed "s/^/$prefix/g"