#! /bin/sh #---------------------------------------------------------------------------- # /var/install/deinstall/carddav2xml - carddav2xml deinstallation # # Copyright (c) 2015-2019 The Eisfair Team, team(at)eisfair(dot)org # # Creation: 2015-04-11 jed # Last Update: $Id$ # # 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. #---------------------------------------------------------------------------- # read eislib etc. . /var/install/include/eislib . /var/install/include/jedlib pgmname=`basename $0` module_name="`echo "${pgmname}" | cut -d- -f1`" # debug mode: true/false #debug=true if ${debug:-false} then exec 2> /tmp/${module_name}-deinstall-trace$$.log set -x ask_debug=true export ask_debug fi update=0 case "${1}" in --update|update) update=1 ;; esac package_filelist=/etc/filelist.d/carddav2xml-files.txt carddav2xml_runpath=/var/lib/${module_name} ### ------------------------------------------------------------------------- ### stop services ### ------------------------------------------------------------------------- /var/install/config.d/${module_name}.sh --uninstallcron ### ------------------------------------------------------------------------- ### remove program files ### ------------------------------------------------------------------------- if [ -f "${package_filelist}" ] then while read line do #check if comment echo "${line}" | grep -q "^#" if [ $? -ne 0 ] then # no comment - go on ... delflag=1 ftype=`echo "${line}" | cut -d' ' -f1` fname=`echo "${line}" | cut -d' ' -f6` case $ftype in b|u) # remove program files if [ "${fname}" = "tmp/install.sh"\ -o "${fname}" = "tmp/preinstall.sh"\ -o "${fname}" = "var/install/config.d/carddav2xml.sh"\ -o "${fname}" = "var/install/deinstall/carddav2xml" ] then delflag=0 fi if [ ${delflag} -eq 1 ] then rm -f /${fname} fi ;; f) # remove directories rmdir --ignore-fail-on-non-empty /${fname} ;; esac fi done < ${package_filelist} # remove file list rm -f ${package_filelist} fi ### ------------------------------------------------------------------------- ### remove other files ### ------------------------------------------------------------------------- if [ ${update} -ne 1 ] then # no update - deinstall rm -f /etc/config.d/${module_name} rm -f /etc/config.d/${module_name}.backup rm -f /etc/backup.d/${module_name}* rm -f /var/install/config.d/${module_name}.sh # remove data path rm -f ${carddav2xml_runpath}/config`echo "${module_name}" | sed -r 's/^.{7}//'`-*.php rm -fr ${carddav2xml_runpath} fi rm -f /var/install/deinstall/carddav2xml ### ------------------------------------------------------------------------- ### remove CardDAV2XML from menu system ### ------------------------------------------------------------------------- if [ ${update} -eq 0 ] then # no update, remove menu /var/install/bin/del-menu "setup.services.menu" "setup.services.carddav2xml.menu" fi myecho --pack ${module_name} "done." ### ------------------------------------------------------------------------- ### end ### -------------------------------------------------------------------------