#! /bin/sh #------------------------------------------------------------------------------ # /var/install/deinstall/clearsilver-dev - deinstall script # # Creation : 2006-10-16 holbru # Last update: $Id$ # # Copyright (c) 2006-2007 the eisfair team, c/o Frank Meyer, # # 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 packages name packages_name=clearsilver-dev # set filelist filelist=/etc/filelist.d/${packages_name}-files.txt # check for update is given if [ "$1" = "update" ] then mecho -info "Updating ${packages_name} (removing previous version)" update=1 else mecho -info "Removing ${packages_name}" update=0 fi #--------------------------------------------------------------------------- # check and remove program files #--------------------------------------------------------------------------- if [ "$update" -eq 0 ] then if [ -f /etc/config.d/${packages_name} ] then if `grep -q "^START_CLEARSILVER_DEV='yes'" /etc/config.d/${packages_name}` then /var/install/config.d/${packages_name}.sh stop_all fi fi fi #---------------------------------------------------------------------------- # remove all files, but no config files #---------------------------------------------------------------------------- while read id perm user group package pfile do case ${id} in b|u) # remove program files if [ "${pfile}" != "tmp/install.sh" -a "${pfile}" != "tmp/preinstall.sh" ] then rm -f /${pfile} fi ;; f) # remove directories rmdir --ignore-fail-on-non-empty /${pfile} ;; esac done < ${filelist} #---------------------------------------------------------------------------- # if update, then exit now #---------------------------------------------------------------------------- if [ "$update" -eq 1 ] then exit 0 fi #---------------------------------------------------------------------------- # remove package from menu system #---------------------------------------------------------------------------- /var/install/bin/del-menu \ setup.services.apache2.config.module.menu \ setup.services.clearsilver-dev.menu #---------------------------------------------------------------------------- # remove config file #---------------------------------------------------------------------------- configfiles="/etc/config.d/${packages_name} \ /etc/backup.d/${packages_name}* \ /etc/check.d/${packages_name}* \ /etc/default.d/${packages_name}" for cfile in ${configfiles} do rm -f ${cfile} done exit 0 #---------------------------------------------------------------------------- # end #----------------------------------------------------------------------------