Bugfixes for last few commits
authorBrian Flowers <git-admn@bsflowers.net>
Mon, 19 Sep 2016 17:18:56 +0000 (13:18 -0400)
committerBrian Flowers <git-admn@bsflowers.net>
Mon, 19 Sep 2016 17:18:56 +0000 (13:18 -0400)
bdsm.d/df.generic
bdsm.d/sensors.generic
bdsm.d/vmstat.generic
bdsm.sh

index 90cbe35..edcdea5 100755 (executable)
@@ -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
index 9d74a79..f9290d0 100755 (executable)
@@ -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
index 7af1e58..a3b1fbe 100755 (executable)
@@ -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 (executable)
--- 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"