source: n4d-samba/trunk/fuentes/debian/prerm

Last change on this file was 806, checked in by hectorgh, 5 years ago

adding prerm

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1#!/bin/sh
2#script for n4d-ldap
3#
4# see: dh_installdeb(1)
5
6set -e
7
8# summary of how this script can be called:
9#        * <prerm> `remove'
10#        * <old-prerm> `upgrade' <new-version>
11#        * <new-prerm> `failed-upgrade' <old-version>
12#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
13#        * <deconfigured's-prerm> `deconfigure' `in-favour'
14#          <package-being-installed> <version> `removing'
15#          <conflicting-package> <version>
16# for details, see http://www.debian.org/doc/debian-policy/ or
17# the debian-policy package
18
19PACKAGE_NAME="n4d-samba"
20ORIGINAL_FILE="/etc/init.d/smbd"
21DIVERT_FILE="/usr/share/n4d-samba/diversions/etc.initd.smbd.divert"
22LLIUREX_FILE="/usr/sbin/smbd-daemon-starter"
23
24
25case "$1" in
26    upgrade|deconfigure)
27    ;;
28
29    remove|purge)
30
31        if [ -f ${DIVERT_FILE} ] ; then
32                rm -rf $LLIUREX_FILE || true
33                dpkg-divert --package  ${PACKAGE_NAME} --rename --quiet --remove ${ORIGINAL_FILE}|| true
34                systemctl daemon-reload || true
35                update-rc.d slapd enable 2 3 4 5 || true
36
37        fi
38
39
40    ;;
41
42    failed-upgrade)
43    ;;
44
45    *)
46        echo "prerm called with unknown argument \`$1'" >&2
47        exit 1
48    ;;
49esac
50
51
52#DEBHELPER#
53
Note: See TracBrowser for help on using the repository browser.