#!/bin/sh #---------------------------------------------------------------------------- # /var/install/deinstall/smartmon - smartmon deinstallation # # Creation: 09.02.2004 jb # Last Update: $Id$ # # Copyright (c) 2004-2008 Jens Berger # # 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. #---------------------------------------------------------------------------- # reading eislib . /var/install/include/eislib rm_file='rm -f' rm_dir='rm -r -f' ### ------------------------------------------------------------------------- ### stop service ### ------------------------------------------------------------------------- /etc/init.d/smartmon stop ### ------------------------------------------------------------------------- ### remove config files ### ------------------------------------------------------------------------- $rm_file /etc/check.d/smartmon $rm_file /etc/check.d/smartmon.exp $rm_file /etc/check.d/smartmon.ext $rm_file /etc/default.d/smartmon $rm_file /etc/smartd.conf $rm_file /etc/filelist.d/smartmon-files.txt ### ------------------------------------------------------------------------- ### remove start/stop scripts ### ------------------------------------------------------------------------- $rm_file /etc/init.d/smartmon $rm_file /etc/rc2.d/K??smartmon $rm_file /etc/rc2.d/S??smartmon ### ------------------------------------------------------------------------- ### remove program files ### ------------------------------------------------------------------------- $rm_file /usr/sbin/smartctl $rm_file /usr/sbin/smartd $rm_file /usr/sbin/gnuplot ### ------------------------------------------------------------------------- ### remove doc ### ------------------------------------------------------------------------- $rm_dir /usr/share/doc/smartmon ### ------------------------------------------------------------------------- ### remove scripts ### ------------------------------------------------------------------------- $rm_file /var/install/bin/smartmon-report $rm_file /var/install/bin/smartmon-mail ### old $rm_file /var/install/bin/smartmon-log ### new $rm_file /var/install/bin/smartmon-plot $rm_file /var/install/config.d/smartmon-update.sh $rm_file /var/install/config.d/smartmon.sh ### ------------------------------------------------------------------------- ### remove webconf files ### ------------------------------------------------------------------------- $rm_file /var/install/form/smartmon $rm_file /var/install/form/smartmon.main $rm_file /var/install/help/smartmon ### ------------------------------------------------------------------------- ### remove tmp files ### ------------------------------------------------------------------------- ### old tmp file location (smartmon_valid + smartmon_devices + smartmon_report) $rm_file /tmp/smartmon_* $rm_file /var/log/smart_*.log $rm_file /var/smartmon/smartmon_valid $rm_file /var/smartmon/smartmon_devices_watch $rm_file /var/smartmon/smartmon_devices_plot $rm_file /var/smartmon/smartmon_warn_attributes ### ------------------------------------------------------------------------- ### remove package description ### ------------------------------------------------------------------------- $rm_file /var/install/packages/smartmon ### ------------------------------------------------------------------------- ### remove deinstall script ### ------------------------------------------------------------------------- $rm_file /var/install/deinstall/smartmon ### ------------------------------------------------------------------------- ### remove mini_httpd menu entry an softlink ### ------------------------------------------------------------------------- if [ -f /usr/local/bin/httpd-menu.sh ]; then # mecho -info "Removing menu entry for mini_httpd" /usr/local/bin/httpd-menu.sh rem "./smartmon/index.html" fi # delete symlink even if mini_httpd has eventually left this file $rm_file /usr/local/htdocs/smartmon if [ "$1" != "update" ]; then ### ------------------------------------------------------------------------- ### remove from menu system ### ------------------------------------------------------------------------- $rm_file /var/install/menu/setup.services.smartmon.menu /var/install/bin/del-menu "setup.services.menu" "setup.services.smartmon.menu" #mecho -info "Removing smartmon config file ..." $rm_file /etc/config.d/smartmon* #mecho -info "Removing smartmon backup files ..." $rm_file /etc/backup.d/smartmon* #mecho -info "Removing smartmon plotting log directory ..." $rm_dir /var/smartmon fi # remove softlinks to /var/smartmon/plot if [ -f /var/install/packages/apache ]; then . /etc/config.d/apache $rm_file $APACHE_DOCUMENT_ROOT/smartmon elif [ -f /var/install/packages/apache2 ]; then . /etc/config.d/apache2 $rm_file $APACHE2_DOCUMENT_ROOT/smartmon fi exit 0