dofsmount=1
dofsumount=0
verbose=0
+use_default_conf=1
+
while echo $1 | grep -q '^-'; do # FIXME: why not '^-'?
case $1 in
[ -z "$2" ] && usage_exit
options="$options $1"
shift
+ use_default_conf=0
conf=$1
;;
--cluster )
shift
done
+
+# if `--cluster` was not passed in, fallback to looking at the config name
+if ! [[ -n "$cluster" ]]; then
+ cluster=`echo $conf | awk -F'/' '{print $(NF)}' | cut -d'.' -f 1`
+else
+ # if we were told to use a given cluster name then $conf needs to be updated
+ # but just define it if `--conf` was not specified, otherwise we would be silently
+ # overriding $conf even if it was defined with `--conf`
+ if [ $use_default_conf -eq 1 ]; then
+ conf="/etc/ceph/$cluster.conf"
+ fi
+fi
+
+
verify_conf
command=$1
for name in $what; do
type=`echo $name | cut -c 1-3` # e.g. 'mon', if $item is 'mon1'
id=`echo $name | cut -c 4- | sed 's/^\\.//'`
-
- # if `--cluster` was not passed in, fallback to looking at the config name
- if ! [[ -n "$cluster" ]]; then
- cluster=`echo $conf | awk -F'/' '{print $(NF)}' | cut -d'.' -f 1`
- fi
num=$id
name="$type.$id"