mkcephfs: nicer empty directory check

From TV.

Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2012-07-16 16:10:57 -07:00
parent 4e66a3b98d
commit 4eec4fc57d

View File

@ -267,7 +267,7 @@ if [ -n "$initdaemon" ]; then
if [ $type = "mon" ]; then
get_conf mon_data "/var/run/ceph/mon/ceph-$id" "mon data"
if [ `ls $mon_data | wc -l` -ne 0 ]; then
if ! find "$mon_data" -maxdepth 0 -empty | read; then
echo "ERROR: $name mon_data directory $mon_data is not empty."
echo " Please make sure that it is empty before running mkcephfs."
exit 1