Debian Codegraph @

debian/postinst

raw symbols SCIP
1 #! /bin/sh
2 # postinst script for ax25-apps
3 #
4 # see: dh_installdeb(1)
5
6 set -e
7
8 # Source the debconf library.
9 . /usr/share/debconf/confmodule
10
11 # summary of how this script can be called:
12 # * <postinst> `configure' <most-recently-configured-version>
13 # * <old-postinst> `abort-upgrade' <new version>
14 # * <conflictor's-postinst> `abort-remove' `in-favour' <package>
15 # <new-version>
16 # * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
17 # <failed-install-package> <version> `removing'
18 # <conflicting-package> <version>
19 # for details, see /usr/doc/packaging-manual/
20 #
21 # quoting from the policy:
22 # Any necessary prompting should almost always be confined to the
23 # post-installation script, and should be protected with a conditional
24 # so that unnecessary prompting doesn't happen if a package's
25 # installation fails and the `postinst' is called with `abort-upgrade',
26 # `abort-remove' or `abort-deconfigure'.
27
28 config_ax25_apps(){
29 # Check result of tools being setuid
30 db_get ax25-apps/suid_listen
31 if [ "$RET" = "true" ]; then
32 {
33 # Try registering with dpkg-statoverride first
34 if ! dpkg-statoverride --list /usr/bin/axlisten >/dev/null 2>&1; then
35 dpkg-statoverride --update --add root root 4755 /usr/bin/axlisten
36 # change program directly
37 else
38 chmod 4755 /usr/bin/axlisten
39 fi
40 }
41 else
42 {
43 # set permission on /usr/bin/axlisten to know state not suid
44 chmod 0755 /usr/bin/axlisten
45 #if dpkg-statoverride is installed, remove axlisten from overrides
46 if dpkg-statoverride --list /usr/bin/axlisten >/dev/null 2>&1; then
47 dpkg-statoverride --remove /usr/bin/axlisten
48 fi
49 }
50 fi
51 }
52
53 convert_to_statoverride(){
54 #try to import suidmanager setting for axlisten
55 if ! dpkg-statoverride --list /usr/bin/axlisten >/dev/null 2>&1; then
56 dpkg-statoverride --add root root 0755 /usr/bin/axlisten
57 fi
58 }
59
60 case "$1" in
61 install)
62 config_ax25_apps
63 ;;
64
65 upgrade)
66 convert_to_statoverride
67 config_ax25_apps
68 ;;
69
70 configure)
71 config_ax25_apps
72 ;;
73
74 abort-upgrade)
75 ;;
76
77 *)
78 echo "postinst called with unknown argument $1" >&2
79 exit 0
80 ;;
81 esac
82
83 # dh_installdeb will replace this with shell code automatically
84 # generated by other debhelper scripts.
85
86 #DEBHELPER#
87 exit 0
88