#! /bin/sh #---------------------------------------------------------------------------- # apache2_php5 - Deinstallation # # Creation: 2006-03-23 MOU # Last Update: $Id$ # # Copyright (c) 2009-2014 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. #---------------------------------------------------------------------------- # include eislib . /var/install/include/eislib # set package name package_name=php5_ccpp # set filelist filelist=/etc/filelist.d/${package_name}-files.txt # check for update is given if [ "${1}" = "--update" ] then update=true fi #---------------------------------------------------------------------------- # remove program files #---------------------------------------------------------------------------- while read id perm user group package file do case ${id} in b|u) # remove program files if [ "${file}" != "tmp/install.sh" \ -a "${file}" != "tmp/preinstall.sh" ] then rm -f /${file} fi ;; f) # remove directories rmdir --ignore-fail-on-non-empty /${file} 2>/dev/null ;; esac done < ${filelist} # ---------------------------------------------------------------------------- # if update, then exit now # ---------------------------------------------------------------------------- if "${update:-false}" then exit 0 fi # ---------------------------------------------------------------------------- # remove config file # ---------------------------------------------------------------------------- configfiles="/etc/config.d/${package_name} \ /etc/backup.d/${package_name}* \ /etc/check.d/${package_name}* \ /etc/default.d/${package_name}" for cfile in ${configfiles} do rm -f ${cfile} done # --------------------------------------------------------------------------- # remove files not listed in filelist # --------------------------------------------------------------------------- rm -f /etc/php5/cli/mysql-conf.ini rmdir --ignore-fail-on-non-empty /etc/php5/cli 2>/dev/null rmdir --ignore-fail-on-non-empty /etc/php5 2>/dev/null # --------------------------------------------------------------------------- # remove menu # --------------------------------------------------------------------------- /var/install/bin/del-menu \ setup.services.menu \ setup.services.${package_name}.menu # --------------------------------------------------------------------------- # security question of keeping the pear folder for later use # --------------------------------------------------------------------------- echo echo "If you answer the following question with 'yes' the complete PEAR folder" echo "will be deleted." echo "If you have additional pear packages installed it is recomended to answer" echo "with 'no' to keep your additional packages." echo yesno=`/var/install/bin/ask "Do you want to DELETE the complete PHP5-pear dir" "n"` if [ "${yesno}" = "yes" ] ; then rm -rf /usr/share/php5 else mecho --info "keeping addaitional pear packages..." echo "If you want to delete them later, you have to do this by hand." echo "Type at the console 'rm -rfv /usr/share/php5'" fi exit 0 # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------