#!/bin/sh #---------------------------------------------------------------------------- # /var/install/deinstall/nscd - deinstall script # # Creation : 2021-12-08 holbru # Last update: $Id$ # # Copyright (c) 2021-@@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=nscd # check for update is given if [ "${1}" = "--update" ] then update=true fi # --------------------------------------------------------------------------- # stop deamon # --------------------------------------------------------------------------- if ! /usr/sbin/service is-enabled ${package_name}.service then quiet='--quiet' fi /usr/sbin/service ${quiet} stop ${package_name}.service /usr/sbin/service disable ${package_name}.service # --------------------------------------------------------------------------- # remove config and check file # --------------------------------------------------------------------------- /usr/bin/rm -f /etc/default.d/${package_name} /usr/bin/rm -f /etc/check.d/${package_name} # --------------------------------------------------------------------------- # stop for update only # --------------------------------------------------------------------------- if ${update:-false} then exit 0 fi # --------------------------------------------------------------------------- # remove package from menu system # --------------------------------------------------------------------------- /var/install/bin/del-menu \ setup.services.menu \ setup.services.${package_name}.menu # --------------------------------------------------------------------------- # remove config file # --------------------------------------------------------------------------- configfiles="/etc/config.d/${package_name} /etc/backup.d/${package_name}.*" for cfile in ${configfiles} do /usr/bin/rm -f ${cfile} done /usr/bin/rm -rf /var/lib/${package_name} /usr/bin/systemctl --no-reload disable --now ${package_name}.service exit 0 # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------