#! /bin/bash # ---------------------------------------------------------------------------- # /var/install/deinstall/php7-cli - deinstall script # # Creation : 2018-11-19 schlotze # Last update: $Id: php7-cli 72416 2020-01-27 22:58:23Z schlotze $ # # Copyright (c) 2018 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=php7-cli # Set filelist filelist=/etc/filelist.d/${package_name}-files.txt # Check if this is an update if [ "${1}" = "--update" ] then update=true fi # --------------------------------------------------------------------------- # stop service # --------------------------------------------------------------------------- if [ -f /etc/init.d/${package_name} ] then /etc/init.d/${package_name} stop fi # --------------------------------------------------------------------------- # remove start/stop scripts # --------------------------------------------------------------------------- rm -f /etc/rc2.d/{S,K}??${package_name} # --------------------------------------------------------------------------- # 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}.* # --------------------------------------------------------------------------- # remove menu # --------------------------------------------------------------------------- /var/install/bin/del-menu \ setup.services.menu \ setup.services.${package_name}.menu # --------------------------------------------------------------------------- # remove module php .ini files and apache2 module config # --------------------------------------------------------------------------- rm -f /etc/php7/cli/conf.d/eisfair.ini rm -f /etc/php7/cli/conf.d/mysql.ini rm -f /etc/php7/cli/conf.d/mysql-conf.ini rm -f /etc/php7/cli/conf.d/mssql.ini rm -f /etc/php7/cli/conf.d/interbase.ini rm -f /etc/php7/cli/conf.d/pgsql.ini rm -f /etc/php7/cli/conf.d/sqlite3.ini rm -f /etc/php7/cli/conf.d/ldap.ini rm -f /etc/php7/cli/conf.d/soap.ini rm -f /etc/php7/cli/conf.d/apcu.ini rm -f /etc/php7/cli/conf.d/redis.ini rm -f /etc/php7/cli/conf.d/advantage.ini rm -f /etc/php7/cli/conf.d/suhosin.ini rmdir --ignore-fail-on-non-empty /etc/php7/cli/conf.d 2>/dev/null rmdir --ignore-fail-on-non-empty /etc/php7/cli 2>/dev/null rmdir --ignore-fail-on-non-empty /etc/php7 2>/dev/null /usr/sbin/update-alternatives --remove php /usr/bin/php-7 exit 0 # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------