bash script - check and delete obsolete php-fpm configs

  • I have created a small bash-script which check and deletes obsolete php-fpm configs (from phpswitcher bug) via cron job.

    Functions:

    - backup of the config files to be deleted

    - delete obsolete php-fpm config files

    - restart of phpswitcher PHP services

    - E-Mail notification


    Use at your own risk - please test in a V-Box before use it!


    Suggestions for improvement are welcome.


    usage:

    apt install mailutils

    nano /root/check-php-conf.sh

    copy & paste the script below

    set your imscp database user & password, email and backup path

    chmod + x /root/check-php-conf.sh

    run /root/check-php-conf.sh via cron job (period 5-15 minutes)


    ## edit ##

    added missing /root path to the awk line ;-)


    Edited 10 times, last by fulltilt ().