]> git.meshlink.io Git - meshlink/blob - debian/postinst
Fix bug when dropping an old connection in favour of a new one from the
[meshlink] / debian / postinst
1 #! /bin/sh
2 # postinst script for tinc
3 #
4 # $Id: postinst,v 1.6.4.1 2000/12/05 09:04:32 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         fi
45
46         if fgrep -q PublicKey `find /etc/tinc -type f` ; then
47             echo "If you are upgrading from version 1.0pre3, make sure you"
48             echo "regenerate the host keys.  For more information, refer to"
49             echo "/usr/share/doc/tinc/UPGRADING.txt."
50         fi
51     ;;
52
53     abort-upgrade|abort-remove|abort-deconfigure)
54
55     ;;
56
57     *)
58         echo "postinst called with unknown argument \`$1'" >&2
59         exit 0
60     ;;
61 esac
62
63 # dh_installdeb will replace this with shell code automatically
64 # generated by other debhelper scripts.
65
66 #DEBHELPER#
67
68 exit 0
69
70