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
# 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
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