#! /bin/bash # ---------------------------------------------------------------------------- # /var/install/deinstall/php8-fpm - deinstall script # # Creation : 2018-11-19 schlotze # Last update: $Id: php8-fpm 67021 2019-08-07 12:59:32Z schlotze $ # # Copyright (c) 2021 the eisfair team, team(at)eisfair(dot)org # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # ---------------------------------------------------------------------------- # Set package name package_name=php8-fpm # Check if this is an update if [ "${1}" = "--update" ] then update=true fi # --------------------------------------------------------------------------- # stop service # --------------------------------------------------------------------------- /usr/sbin/service stop ${package_name}.service /usr/sbin/service disable ${package_name}.service # --------------------------------------------------------------------------- # remove config and check file # --------------------------------------------------------------------------- rm -f /etc/default.d/${package_name} rm -f /etc/check.d/${package_name} rm -f /etc/check.d/${package_name}.* # ---------------------------------------------------------------------------- # Stop deinstallation here, it's just an update # ---------------------------------------------------------------------------- if ${update:-false} then exit 0 fi # --------------------------------------------------------------------------- # remove config file # --------------------------------------------------------------------------- . /etc/config.d/${package_name} rm -f /etc/config.d/${package_name} rm -f /etc/backup.d/${package_name}.* rm -f /etc/logrotate.d/php-fpm # --------------------------------------------------------------------------- # remove module php .ini files and apache2 module config # --------------------------------------------------------------------------- rm -f /etc/apache2/mods-enabled/php8-fpm.conf rm -f /etc/apache2/mods-available/php8-fpm.conf rm -f /etc/php8/fpm/conf.d/eisfair.ini rm -f /etc/php8/fpm/conf.d/mysql.ini rm -f /etc/php8/fpm/conf.d/mysql-conf.ini rm -f /etc/php8/fpm/conf.d/mssql.ini rm -f /etc/php8/fpm/conf.d/interbase.ini rm -f /etc/php8/fpm/conf.d/pgsql.ini rm -f /etc/php8/fpm/conf.d/sqlite3.ini rm -f /etc/php8/fpm/conf.d/ldap.ini rm -f /etc/php8/fpm/conf.d/soap.ini rm -f /etc/php8/fpm/conf.d/apcu.ini rm -f /etc/php8/fpm/conf.d/redis.ini rm -f /etc/php8/fpm/conf.d/advantage.ini rm -f /etc/php8/fpm/conf.d/suhosin.ini rmdir --ignore-fail-on-non-empty /etc/php8/fpm/conf.d 2>/dev/null rmdir --ignore-fail-on-non-empty /etc/php8/fpm 2>/dev/null rmdir --ignore-fail-on-non-empty /etc/php8 2>/dev/null /usr/sbin/update-alternatives --remove php-fpm /usr/sbin/php8-fpm /usr/sbin/service daemon-reload exit 0 # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------