Commits

Zhang Huangbin  committed 26d7187

Use absolute path of bash in cron jobs.
Thanks viq@bitbucket.

  • Participants
  • Parent commits 6a3cfb0

Comments (0)

Files changed (2)

File iRedMail/conf/global

 export BIN_BZIP2='bzip2'
 export PKG_BZIP2='bzip2'
 
-# Shell: /sbin/nologin.
+# Shells
 export SHELL_NOLOGIN='/sbin/nologin'
+export SHELL_BASH='/bin/bash'
 
 # Check hardware architecture.
 arch="$(uname -m)"
     if echo "${DISTRO_VERSION}" | grep '^7' &>/dev/null ; then
         export UNSUPPORTED_RELEASE='YES'
     fi
+
+    export SHELL_BASH='/usr/local/bin/bash'
 elif [ X"${KERNEL_NAME}" == X'OPENBSD' ]; then
     export DISTRO='OPENBSD'
     export DISTRO_VERSION="$(uname -r)"
 
     # Directory of RC scripts.
     export DIR_RC_SCRIPTS='/etc/rc.d'
-
     export RC_CONF_LOCAL='/etc/rc.conf.local'
+    export SHELL_BASH='/usr/local/bin/bash'
 else
     # Not support *BSD and other distrobutions yet.
     echo "Error: Your OS is not supported yet."

File iRedMail/functions/cleanup.sh

         # Add cron job
         cat >> ${CRON_SPOOL_DIR}/root <<EOF
 # ${PROG_NAME}: Backup OpenLDAP data on 03:00 AM
-0   3   *   *   *   bash ${BACKUP_SCRIPT_OPENLDAP}
+0   3   *   *   *   ${SHELL_BASH} {${BACKUP_SCRIPT_OPENLDAP}
 EOF
 
         cat >> ${TIP_FILE} <<EOF
         # Add cron job
         cat >> ${CRON_SPOOL_DIR}/root <<EOF
 # ${PROG_NAME}: Backup MySQL databases on 03:30 AM
-30   3   *   *   *   bash ${BACKUP_SCRIPT_MYSQL}
+30   3   *   *   *   ${SHELL_BASH} ${BACKUP_SCRIPT_MYSQL}
 EOF
 
         cat >> ${TIP_FILE} <<EOF
     #   Add cron job
     #   cat >> ${CRON_SPOOL_DIR}/root <<EOF
 ## Backup on 03:30 AM
-#30   3   *   *   *   bash ${BACKUP_SCRIPT_PGSQL}
+#30   3   *   *   *   ${SHELL_BASH} ${BACKUP_SCRIPT_PGSQL}
 #EOF
     #fi