From 1e2c54aede5767bbd2df4ae448cfe8cbf501a826 Mon Sep 17 00:00:00 2001 From: Brian Flowers Date: Mon, 19 Sep 2016 14:06:36 -0400 Subject: [PATCH] additional bugfixes for last few commits --- bdsm.d/df.generic | 4 ++-- bdsm.d/sensors.generic | 6 +++--- bdsm.sh | 8 +++++++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/bdsm.d/df.generic b/bdsm.d/df.generic index edcdea5..5c628fd 100755 --- a/bdsm.d/df.generic +++ b/bdsm.d/df.generic @@ -66,10 +66,10 @@ start() fi ssh -q $HOSTNAME <> $OUTPATH + nohup stdbuf -o0 echo "\$ts|$HOSTNAME|DISK-$LABEL-USED|\$df" >> $OUTPATH sleep $DELAY done & EOF diff --git a/bdsm.d/sensors.generic b/bdsm.d/sensors.generic index f9290d0..3be2098 100755 --- a/bdsm.d/sensors.generic +++ b/bdsm.d/sensors.generic @@ -62,12 +62,12 @@ start() fi ssh -q $HOSTNAME < /home/bdsm/in.fifo & + ssh -q $host "cat /home/bdsm/out.fifo" > /home/bdsm/in.fifo & echo $! > /home/bdsm/pids/$host.in j=0 while read -u10 line; do command=`echo $line | cut -d' ' -f1` + if [ "$command" == "" ]; then + continue + fi args="`echo $line | cut -d' ' -f2-`" if [ -f /home/bdsm/bdsm.d/$command.$type ]; then /home/bdsm/bdsm.d/$command.$type start $host $args @@ -207,6 +210,9 @@ stop() j=0 echo $functions | tr ';' '\n' | sed 's/[(),]/ /g' | while read line; do command=`echo $line | cut -d' ' -f1` + if [ "$command" == "" ]; then + continue + fi args="`echo $line | cut -d' ' -f2-`" if [ -f /home/bdsm/bdsm.d/$command.$type ]; then /home/bdsm/bdsm.d/$command.$type stop $host $args -- 1.8.3.1