ffe4dce470b0f4585b11c29e61e69c9e31d9e7b4
[tinc] / debian / postinst
1 #! /bin/sh
2 # postinst script for tinc
3 #
4 # $Id: postinst,v 1.2 2000/05/16 13:03:32 zarq Exp $
5 #
6 # see: dh_installdeb(1)
7
8 set -e
9
10 # summary of how this script can be called:
11 #        * <postinst> `configure' <most-recently-configured-version>
12 #        * <old-postinst> `abort-upgrade' <new version>
13 #        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
14 #          <new-version>
15 #        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
16 #          <failed-install-package> <version> `removing'
17 #          <conflicting-package> <version>
18 # for details, see /usr/doc/packaging-manual/
19 #
20 # quoting from the policy:
21 #     Any necessary prompting should almost always be confined to the
22 #     post-installation script, and should be protected with a conditional
23 #     so that unnecessary prompting doesn't happen if a package's
24 #     installation fails and the `postinst' is called with `abort-upgrade',
25 #     `abort-remove' or `abort-deconfigure'.
26
27 case "$1" in
28     configure)
29         if [ ! -e /dev/.devfs ] ; then
30             devices_exist=1
31             for d in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; do
32                 test -e /dev/tap$d || $devices_exist=0
33             done
34             if [ $devices_exist -eq 0 ] ; then
35                 cd /dev && ./MAKEDEV netlink || true
36             fi
37         fi
38
39     ;;
40
41     abort-upgrade|abort-remove|abort-deconfigure)
42
43     ;;
44
45     *)
46         echo "postinst called with unknown argument \`$1'" >&2
47         exit 0
48     ;;
49 esac
50
51 # dh_installdeb will replace this with shell code automatically
52 # generated by other debhelper scripts.
53
54 #DEBHELPER#
55
56 exit 0
57
58