#!/bin/sh # ---------------------------------------------------------------------------- # /var/install/deinstall/phpmyadmin - deinstall script # # Creation: 2006-09-15 starwarsfan # Last Update: $Id$ # # Copyright (c) 2006-2009 the eisfair team, team(at)eisfair(dot)org # Maintained by Y. Schumann, yves(at)eisfair(dot)org # Copyright (c) 2015-@@YEAR@@ Holger Bruenjes, holgerbruenjes(at)gmx(dot)net # # 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='phpmyadmin' # set filelist filelist=/etc/filelist.d/${package_name}51-files.txt if [ "${1}" = "--update" ] then update=true fi # ---------------------------------------------------------------------------- # remove config and check file # ---------------------------------------------------------------------------- rm -f /etc/default.d/${package_name} rm -f /etc/check.d/${package_name}* # --------------------------------------------------------------------------- # remove program files # --------------------------------------------------------------------------- while read id perm user group package file do case ${id} in b|u|s) # 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} # remove programm folder rm -rf /var/lib/${package_name}/phpMyAdmin rm -rf /usr/share/doc/phpMyAdmin # --------------------------------------------------------------------------- # stop remove for update only # --------------------------------------------------------------------------- if ${update:-false} then exit 0 fi # --------------------------------------------------------------------------- # remove http aliase # --------------------------------------------------------------------------- . /etc/config.d/${package_name} vhost_alias_path='/etc/apache2/vhost' inst_servername=${PHPMYADMIN_INSTALL_HOST} inst_alias=${PHPMYADMIN_INSTALL_HOST_ALIAS} rm -f ${vhost_alias_path}/{,v}host-${inst_servername}-${inst_alias} # write new apache config /var/install/config.d/apache2.sh rm -f /etc/apache2/mods-available/${package_name}.conf rm -f /etc/apache2/mods-enabled/${package_name}.conf rm -f /etc/apache2/mods-available/virtualhost-${package_name}.conf rm -f /etc/apache2/mods-enabled/virtualhost-${package_name}.conf # reload apache2 configuration if apache is running if [ -f /run/httpd.pid -a -f /etc/init.d/apache2 ] then /etc/init.d/apache2 stop sleep 5 /etc/init.d/apache2 start fi # --------------------------------------------------------------------------- # remove config file # --------------------------------------------------------------------------- rm -f /etc/config.d/${package_name} rm -f /etc/backup.d/${package_name}* rm -f /etc/filelist.d/${package_name}-files.txt rm -f /etc/default.d/swekey.sample.conf* rm -f /etc/swekey.conf rm -f /etc/logrotate.d/phpmyadmin rm -f /var/install/menu/setup.services.apache2.config.modules.phpmyadmin.logfileview.* # remove folder rm -rf /var/lib/${package_name} rm -rf /etc/phpMyAdmin exit 0 # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------