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