if [[ $what = "" ]]; then
# extract list of monitors, mdss, osds defined in startup.conf
- what=`$CCONF -c $startup_conf -l mon | egrep -v '^mon$' ; \
- $CCONF -c $startup_conf -l mds | egrep -v '^mds$' ; \
- $CCONF -c $startup_conf -l osd | egrep -v '^osd$'`
+ what=`$CCONF -c $conf -l mon | egrep -v '^mon$' ; \
+ $CCONF -c $conf -l mds | egrep -v '^mds$' ; \
+ $CCONF -c $conf -l osd | egrep -v '^osd$'`
fi
+ # get hostname, minus any domain
hostname=`hostname | cut -d . -f 1`
-for item in $what; do
+for name in $what; do
- type=`echo $name | cut -c 1-3`
+ type=`echo $item | cut -c 1-3` # e.g. 'mon', if $item is 'mon1'
+ sections="$name $type global"
+ num=`echo $name | cut -c 4-`
# this host?
- host=`$CCONF -c $startup_conf -s $item -s $type -s global host`
+ host=`$CCONF -c $conf -s $name -s $type -s global host`
ssh=""
cmd=""
if [[ $host != "" ]]; then