sudo su $user -c "$1" || { [ -z "$3" ] && echo "failed: '$1'" && exit 1; }
fi
else
- [ $verbose -eq 1 ] && echo "--- $ssh $2 \"cd $dir ; ulimit -c unlimited ; $1\""
- $ssh $2 "cd $dir ; ulimit -c unlimited ; $1" || { [ -z "$3" ] && echo "failed: '$ssh $1'" && exit 1; }
+ [ $verbose -eq 1 ] && echo "--- $ssh $2 \"cd $sshdir ; ulimit -c unlimited ; $1\""
+ $ssh $2 "cd $sshdir ; ulimit -c unlimited ; $1" || { [ -z "$3" ] && echo "failed: '$ssh $1'" && exit 1; }
fi
}
sudo bash -c "$1" || { echo "failed: '$1'" ; exit 1; }
fi
else
- [ $verbose -eq 1 ] && echo "--- $rootssh $2 \"cd $dir ; ulimit -c unlimited ; $1\""
- $rootssh $2 "cd $dir ; ulimit -c unlimited ; $1" || { echo "failed: '$rootssh $1'" ; exit 1; }
+ [ $verbose -eq 1 ] && echo "--- $rootssh $2 \"cd $sshdir ; ulimit -c unlimited ; $1\""
+ $rootssh $2 "cd $sshdir ; ulimit -c unlimited ; $1" || { echo "failed: '$rootssh $1'" ; exit 1; }
fi
}
fi
-### prepare-btrfs ###
+### prepare-osdfs ###
-if [ -n "$preparebtrfs" ]; then
- name=$preparebtrfs
+if [ -n "$prepareosdfs" ]; then
+ name=$prepareosdfs
type=`echo $name | cut -c 1-3` # e.g. 'mon', if $name is 'mon1'
id=`echo $name | cut -c 4- | sed 's/\\.//'`
name="$type.$id"
fi
if [ $mkbtrfs -eq 1 ]; then
- do_root_cmd "$0 -d $rdir --prepare-btrfs $name"
+ do_root_cmd "$0 -d $rdir --prepare-osdfs $name"
fi
do_cmd "$0 -d $rdir --init-daemon $name"