]> git.deb.at Git - pkg/beep.git/blob - debian/postinst
Imported Debian patch 1.2.2-24
[pkg/beep.git] / debian / postinst
1 #!/bin/sh -e
2 # postinst for beep
3 # copyright 2002-2009 by Gerfried Fuchs <rhonda@debian.at>
4 # Licenced under BSD style
5
6 # Source debconf library.
7 if [ -e /usr/share/debconf/confmodule ]; then
8         . /usr/share/debconf/confmodule
9 fi
10
11 if [ "$1" != configure ]; then
12         exit 0
13 fi
14
15 suid=false
16 if [ -e /usr/share/debconf/confmodule ]; then
17         db_get beep/suid_option
18         suid="$RET"
19 fi
20
21 # option changes as suggested by #492724
22 if [ "$suid" = "suid root for all" ] ; then
23         db_set beep/suid_option "usable for all"
24         suid="usable for all"
25 fi
26 if [ "$suid" = "suid root with only group audio executable" ] ; then
27         db_set beep/suid_option "usable for group audio"
28         suid="usable for group audio"
29 fi
30 if [ "$suid" = "not suid at all" ] ; then
31         db_set beep/suid_option "usable only for root"
32         suid="usable only for root"
33 fi
34
35
36 if [ -x /usr/sbin/dpkg-statoverride ] ; then
37         if ! dpkg-statoverride --list /usr/bin/beep >/dev/null ; then
38                 if [ "$suid" = "usable for all" ] ; then
39                         chmod 4755 /usr/bin/beep
40                 elif [ "$suid" = "usable for group audio" ] ; then
41                         chmod 4754 /usr/bin/beep
42                 elif [ "$suid" = "usable only for root" ] ; then
43                         chmod 0755 /usr/bin/beep
44                 fi
45         fi
46 else
47         if [ "$suid" = "usable for all" ] ; then
48                 chmod 4755 /usr/bin/beep
49         elif [ "$suid" = "usable for group audio" ] ; then
50                 chmod 4754 /usr/bin/beep
51         elif [ "$suid" = "usable only for root" ] ; then
52                 chmod 0755 /usr/bin/beep
53         fi
54 fi