Debian Codegraph @

debian/network-manager.postinst

raw
1 #!/bin/sh
2
3 set -e
4
5 # This script can be called in the following ways:
6 #
7 # After the package was installed:
8 # <postinst> configure <old-version>
9 #
10 #
11 # If prerm fails during upgrade or fails on failed upgrade:
12 # <old-postinst> abort-upgrade <new-version>
13 #
14 # If prerm fails during deconfiguration of a package:
15 # <postinst> abort-deconfigure in-favour <new-package> <version>
16 # removing <old-package> <version>
17 #
18 # If prerm fails during replacement due to conflict:
19 # <postinst> abort-remove in-favour <new-package> <version>
20
21 case "$1" in
22 configure)
23 # This directory can contain sensitive data and should not be world-readable
24 chmod 0700 /var/lib/NetworkManager
25
26 NIF=/etc/network/interfaces
27 if [ -z "$2" ] && [ -f $NIF ]; then
28 ifaces=`grep -v '^#' $NIF | awk '/iface/ {print $2}' | sort -u | sed -e 's/lo//' -e '/^$/d' -e 's/^/- /'`
29 if [ -n "$ifaces" ]; then
30 echo "" 1>&2
31 echo "The following network interfaces were found in $NIF" 1>&2
32 echo "which means they are currently configured by ifupdown:" 1>&2
33 echo "$ifaces" 1>&2
34 echo "If you want to manage those interfaces with NetworkManager instead" 1>&2
35 echo "remove their configuration from $NIF." 1>&2
36 echo "" 1>&2
37 fi
38 fi
39
40 ;;
41
42 abort-upgrade|abort-deconfigure|abort-remove)
43 ;;
44
45 *)
46 echo "$0 called with unknown argument \`$1'" 1>&2
47 exit 1
48 ;;
49 esac
50
51 #DEBHELPER#
52