mod_php_install.sh: Disable cronjobs during installation.

This commit is contained in:
Christoph 2018-02-17 15:27:15 +01:00
parent b0430b7b69
commit 5294bd24eb

View File

@ -28,6 +28,8 @@ _POST_MAX_SIZE="128M"
_SKIP_UPDATE_DB=no _SKIP_UPDATE_DB=no
_CRONTAB_BAKUP_FILE="$(mktemp)"
## --- Some functions ## --- Some functions
## --- ## ---
@ -1081,6 +1083,35 @@ if [[ -d "/usr/include/x86_64-linux-gnu/curl" ]] && [[ ! -e "/usr/include/curl"
echo "" echo ""
fi fi
## - Disable crontab for user root
## -
_crontab_found=false
echononl "\tBackup crontab"
crontab -u root -l >> $_CRONTAB_BAKUP_FILE 2> $tmp_err_msg
if [ "$?" = "0" ]; then
echo_ok
_crontab_found=true
else
if [[ ! -s "$_CRONTAB_BAKUP_FILE" ]] ; then
echo_skipped
warn "No crontab for user 'root'found."
else
echo_failed
error "$(cat $tmp_err_msg)"
fi
fi
if $_crontab_found ; then
echononl "\tDisable crontab for user root"
crontab -r -u root >> ${logdir}/main.log 2>&1
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
fi
fi
echo "" echo ""
echo "" echo ""
echo -e "\t---" echo -e "\t---"
@ -3335,6 +3366,35 @@ fi
## - END: configure OPCache ## - END: configure OPCache
## ----- ## -----
## -----
## - Reenable crontab
## -----
echo
echononl "\tReenable crontab for user root .."
crontab -u root $_CRONTAB_BAKUP_FILE > $tmp_err_msg 2>&1
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
error "$(cat $tmp_err_msg)"
fi
echononl "Remove crontab backup file .."
rm -f $_CRONTAB_BAKUP_FILE > $tmp_err_msg 2>&1
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
error "$(cat $tmp_err_msg)"
fi
## -----
## - End: Reenable crontab
## -----
## ----- ## -----
## - Start PHP-FPM Engine if requested ## - Start PHP-FPM Engine if requested
## ----- ## -----