Commits

Zhang Huangbin committed e9745e7

Typo.

Comments (0)

Files changed (1)

iRedMail/functions/postgresql.sh

 {
     ECHO_INFO "Configure PostgreSQL database server." 
 
-    # FreeBSD: Start pgsql when system start up.
-    # Warning: We must have 'postgresql_enable=YES' before start/stop mysql daemon.
-    if [ X"${DISTRO}" == X'FREEBSD' ]; then
+    # Init db
+    if [ X"${DISTRO}" == X'RHEL' ]; then
+        ${PGSQL_RC_SCRIPT} initdb &>/dev/null
+    elif [ X"${DISTRO}" == X'SUSE' ]; then
+        su - ${PGSQL_SYS_USER} -c "initdb -D ${PGSQL_DATA_DIR} -U ${PGSQL_SYS_USER} -A trust" >/dev/null
+    elif [ X"${DISTRO}" == X'FREEBSD' ]; then
+        # FreeBSD: Start pgsql when system start up.
+        # Warning: We must have 'postgresql_enable=YES' before start/stop pgsql daemon.
         freebsd_enable_service_in_rc_conf 'postgresql_enable' 'YES'
+
         ${PGSQL_RC_SCRIPT} initdb &>/dev/null
     elif [ X"${DISTRO}" == X'OPENBSD' ]; then
         mkdir -p ${PGSQL_DATA_DIR} 2>/dev/null
         su - ${PGSQL_SYS_USER} -c "initdb -D ${PGSQL_DATA_DIR} -U ${PGSQL_SYS_USER} -A trust" >/dev/null
     fi
 
-    if [ X"${DISTRO}" == X'RHEL' ]; then
-        ${PGSQL_RC_SCRIPT} initdb &>/dev/null
-    elif [ X"${DISTRO}" == X'SUSE' ]; then
-        su - ${PGSQL_SYS_USER} -c "initdb -D ${PGSQL_DATA_DIR} -U ${PGSQL_SYS_USER} -A trust" >/dev/null
-    fi
-
     backup_file ${PGSQL_CONF_PG_HBA} ${PGSQL_CONF_POSTGRESQL}
 
     ECHO_DEBUG "Listen on only localhost"