#!/bin/sh #---------------------------------------------------------------------------- # /var/install/deinstall/yowsup - deinstall script # # Copyright (c) 2015-2017 The Eisfair Team, team(at)eisfair(dot)org # # Creation : 2015-12-30 root # 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. #---------------------------------------------------------------------------- # include eislib . /var/install/include/eislib #exec 2>/tmp/yowsup-deinstall-trace-$$.log #set -x # set package name package_name=yowsup # set filelist package_filelist=/etc/filelist.d/${package_name}-files.txt # check for update is given update=false case $1 in (*update) update=true ;; esac # --------------------------------------------------------------------------- # 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" ] 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 if [ ${update} = "false" ] then rm -f /etc/config.d/${package_name} rm -f /etc/backup.d/${package_name}.* if [ -f /root/.yowsup -o -f /root/.yowsup-config ] then mecho --warn "The Yowsup key files in /root/.yowsup and the configuration" mecho --warn "file /root/.yowsup-config will be preserved!" fi if [ -d /home/nagios ] then if [ -f /home/nagios/.yowsup -o -f /home/nagios/.yowsup-config ] then mecho --warn "The Yowsup key files in /home/nagios/.yowsup and the configuration" mecho --warn "file /home/nagios/.yowsup-config will be preserved!" fi fi fi # --------------------------------------------------------------------------- # remove entry from menu system # --------------------------------------------------------------------------- if [ ${update} = "false" ] then # no update, remove menu /var/install/bin/del-menu setup.services.menu setup.services.${package_name}.menu fi exit 0 # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------