~ubuntu-branches/ubuntu/dapper/ntp/dapper

« back to all changes in this revision

Viewing changes to debian/ntpdate.postinst

  • Committer: Bazaar Package Importer
  • Author(s): Scott James Remnant
  • Date: 2006-01-04 15:56:23 UTC
  • Revision ID: james.westby@ubuntu.com-20060104155623-5kjjd8cuawgqzrhq
Tags: 1:4.2.0a+stable-8.1ubuntu2
Remove ntpdate init script, instead install a script in
/etc/network/if-up.d that sets the clock whenever we bring up a network
interface.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh -e
 
2
# This script can be called in the following ways:
 
3
#
 
4
# After the package was installed:
 
5
#       <postinst> configure <old-version>
 
6
#
 
7
#
 
8
# If prerm fails during upgrade or fails on failed upgrade:
 
9
#       <old-postinst> abort-upgrade <new-version>
 
10
#
 
11
# If prerm fails during deconfiguration of a package:
 
12
#       <postinst> abort-deconfigure in-favour <new-package> <version>
 
13
#                  removing <old-package> <version>
 
14
#
 
15
# If prerm fails during replacement due to conflict:
 
16
#       <postinst> abort-remove in-favour <new-package> <version>
 
17
 
 
18
 
 
19
# Remove a no-longer used conffile
 
20
rm_conffile()
 
21
{
 
22
    CONFFILE="$1"
 
23
 
 
24
    if [ -e "$CONFFILE" ]; then
 
25
        echo "Removing obsolete conffile $CONFFILE"
 
26
        rm -f "$CONFFILE"
 
27
    fi
 
28
}
 
29
 
 
30
 
 
31
# Remove ntpdate init script
 
32
rm_init_script()
 
33
{
 
34
    rm_conffile /etc/init.d/ntpdate
 
35
    update-rc.d ntpdate remove
 
36
}
 
37
 
 
38
 
 
39
case "$1" in
 
40
    configure)
 
41
        if dpkg --compare-versions "$2" lt "1:4.2.0a+stable-8.1ubuntu2"; then
 
42
            rm_init_script
 
43
        fi
 
44
        ;;
 
45
 
 
46
    abort-upgrade|abort-deconfigure|abort-remove)
 
47
        ;;
 
48
 
 
49
    *)
 
50
        echo "$0 called with unknown argument \`$1'" 1>&2
 
51
        exit 1
 
52
        ;;
 
53
esac
 
54
 
 
55
#DEBHELPER#
 
56
exit 0
 
57