bugfixes on compatibility
authorBrian Flowers <git-admn@bsflowers.net>
Mon, 19 Sep 2016 03:18:43 +0000 (23:18 -0400)
committerBrian Flowers <git-admn@bsflowers.net>
Mon, 19 Sep 2016 03:18:43 +0000 (23:18 -0400)
bdsm.sh

diff --git a/bdsm.sh b/bdsm.sh
index 79a22e0..ac2ab78 100755 (executable)
--- a/bdsm.sh
+++ b/bdsm.sh
@@ -361,7 +361,7 @@ configure()
         error "$service plugin not found!"
       fi
      
-      max=`echo $params | wc -l`
+      max=`/home/bdsm/bdsm.d/$serviceFile help | grep "^::" | wc -l`
       newservice=`echo $service | cut -d'(' -f1`"("
       i=1
       while [ $i -le $max ]; do
@@ -380,7 +380,7 @@ configure()
     # Validate removal/replacement of old service
     # TODO
     curHost="`cat /home/bdsm/.bdsm.conf.tmp | grep ":$host{"`"
-    curHost=`echo $curHost | sed "s/$service;//g" | sed "s/}\$/$newservice;}/g"`
+    curHost=`echo $curHost | sed "s/$service;//g" | sed "s|}\$|$newservice;}|g"`
     cat /home/bdsm/.bdsm.conf.tmp | \
       grep -v ":$host{" \
       > /home/bdsm/.bdsm.conf.tmp2
@@ -388,7 +388,6 @@ configure()
     mv /home/bdsm/.bdsm.conf.tmp2 /home/bdsm/.bdsm.conf.tmp
     # Reload the hosts list
     hosts=$(cat /home/bdsm/.bdsm.conf.tmp | cut -d'{' -f1)
-set +x
   done
   
   # Convert config back to a more readable format