~ubuntu-branches/ubuntu/gutsy/dhcp/gutsy-security

« back to all changes in this revision

Viewing changes to debian/dhcp-client.postinst

  • Committer: Bazaar Package Importer
  • Author(s): Eloy A. Paris
  • Date: 2004-05-26 12:00:58 UTC
  • Revision ID: james.westby@ubuntu.com-20040526120058-w2v4k2cstzp3qvfb
Tags: 2.0pl5-19
Use invoke-rc.d if available when starting the DHCP server.
(Closes: #250878)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh -e
 
2
#
 
3
# $Id: dhcp-client.postinst,v 1.3.2.3 2004/05/26 16:45:04 peloy Exp $
 
4
#
 
5
 
 
6
case "$1" in
 
7
        configure)
 
8
                # continue below
 
9
        ;;
 
10
 
 
11
        abort-upgrade|abort-remove|abort-deconfigure)
 
12
                exit 0
 
13
        ;;
 
14
 
 
15
        *)
 
16
                echo "postinst called with unknown argument \`$1'" >&2
 
17
                exit 0
 
18
        ;;
 
19
esac
 
20
 
 
21
PATH_DHCLIENT_DB=/var/lib/dhcp/dhclient.leases
 
22
 
 
23
# --- Begin FHS migration code ---
 
24
 
 
25
# Starting with dhcp-2.0pl5-10 we are FHS-compliant. The following
 
26
#       code takes care of moving important files in the old, non
 
27
#       FHS-compliant directory (/var/dhcp/) to their new location
 
28
#       (/var/lib/dhcp/)
 
29
if [ -d /var/dhcp/ ]; then
 
30
        mv /var/dhcp/dhclient* /var/lib/dhcp/ 2> /dev/null || true
 
31
        rmdir /var/dhcp/ 2> /dev/null || true
 
32
fi
 
33
 
 
34
# --- End FHS migration code ---
 
35
 
 
36
if [ ! -e $PATH_DHCLIENT_DB ]; then
 
37
        touch $PATH_DHCLIENT_DB
 
38
fi
 
39
 
 
40
# We handle the multiple occurence of the manual page dhcp-options.5 through
 
41
#       the alternative system. It is nice to have this page in all the
 
42
#       dhcp* packages and since I can't make one package to conflict
 
43
#       with the others the alternatives system looks like a good way
 
44
#       to solve the problem.
 
45
if [ "$1" != upgrade ]; then
 
46
        update-alternatives --install /usr/share/man/man5/dhcp-options.5.gz \
 
47
                                dhcp-options.5.gz \
 
48
                                /usr/share/man/man5/dhcp-options-dhclient.5.gz \
 
49
                                100
 
50
fi
 
51
 
 
52
# I failed to handle the /usr/doc transition when I should have (shame
 
53
# on me; sorry Joey). This is an attempt to fix my oversight: if
 
54
# /usr/doc/dhcp-client is a symlink we remove it.
 
55
if [ -h /usr/doc/dhcp-client ]; then
 
56
        rm -f /usr/doc/dhcp-client
 
57
fi
 
58
 
 
59
# Since 2.0pl5-6.1 we do not start dhclient ourselves, we rely on
 
60
# ifup/ifdown or the PCMCIA subsystem for this. So, we remove here
 
61
# the old init script and the rc.d links.
 
62
rm -f /etc/init.d/dhcp-client
 
63
update-rc.d dhcp-client remove > /dev/null 2>&1
 
64
 
 
65
#DEBHELPER#
 
66
 
 
67
exit 0