diff --git a/mod_php_install.sh b/mod_php_install.sh index 1be669c..8a5034e 100755 --- a/mod_php_install.sh +++ b/mod_php_install.sh @@ -28,6 +28,8 @@ _POST_MAX_SIZE="128M" _SKIP_UPDATE_DB=no +_CRONTAB_BAKUP_FILE="$(mktemp)" + ## --- Some functions ## --- @@ -1081,6 +1083,35 @@ if [[ -d "/usr/include/x86_64-linux-gnu/curl" ]] && [[ ! -e "/usr/include/curl" echo "" 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 -e "\t---" @@ -3335,6 +3366,35 @@ fi ## - 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 ## -----