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