Better function name for the initialization check in mysql-prepare-db-dir.sh

This commit is contained in:
Honza Horak 2016-07-14 19:52:12 +02:00
parent 10ba86daf1
commit dac8b4cb1e

View File

@ -17,7 +17,7 @@ ls_check_datadir ()
# Checks whether datadir should be initialized # Checks whether datadir should be initialized
# @param <dir> datadir # @param <dir> datadir
can_initialize () should_initialize ()
{ {
case `ls_check_datadir "$1"` in case `ls_check_datadir "$1"` in
""|lost+found) true ;; ""|lost+found) true ;;
@ -76,7 +76,7 @@ chmod 0640 "$errlogfile"
[ -x /sbin/restorecon ] && /sbin/restorecon "$errlogfile" [ -x /sbin/restorecon ] && /sbin/restorecon "$errlogfile"
# Make the data directory if doesn't exist or empty # Make the data directory if doesn't exist or empty
if can_initialize "$datadir" ; then if should_initialize "$datadir" ; then
# First, make sure $datadir is there with correct permissions # First, make sure $datadir is there with correct permissions
# (note: if it's not, and we're not root, this'll fail ...) # (note: if it's not, and we're not root, this'll fail ...)
if [ ! -e "$datadir" -a ! -h "$datadir" ] if [ ! -e "$datadir" -a ! -h "$datadir" ]