diff --git a/ezjail-admin b/ezjail-admin index de91655..e343e6e 100755 --- a/ezjail-admin +++ b/ezjail-admin @@ -278,7 +278,7 @@ create) # if a directory at the specified jail root already exists, refuse to # install. Empty root dirs are considered okay, sometimes they are # mount points to be filled by ezjail. - [ -d ${ezjail_rootdir} ] && [ "`ls -A ${ezjail_rootdir} | wc -l`" -eq 0 ] && ezjail_rootdirempty="YES" + [ -d ${ezjail_rootdir} -a -z "`ls -I ${ezjail_rootdir}`" ] && ezjail_rootdirempty="YES" [ -e ${ezjail_rootdir} -a -z "${ezjail_rootdirempty}" -a -z "${ezjail_exists}" ] && exerr "Error: the specified jail root ${ezjail_rootdir} already exists." # if jail root specified on command line does not lie within our jail