source: trunk/debathena/debathena/kiosk/debian/debathena-kiosk.postinst @ 25557

Revision 25557, 1.5 KB checked in by jdreed, 12 years ago (diff)
In kiosk: * Support launching from lightdm
  • Property svn:executable set to *
Line 
1#!/bin/sh
2# postinst script for debathena-kiosk
3#
4# see: dh_installdeb(1)
5
6set -e
7
8# summary of how this script can be called:
9#        * <postinst> `configure' <most-recently-configured-version>
10#        * <old-postinst> `abort-upgrade' <new version>
11#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
12#          <new-version>
13#        * <postinst> `abort-remove'
14#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
15#          <failed-install-package> <version> `removing'
16#          <conflicting-package> <version>
17# for details, see http://www.debian.org/doc/debian-policy/ or
18# the debian-policy package
19
20
21case "$1" in
22    configure)
23        # Add the kiosk user.
24        user=kiosk@mit
25        if ! getent passwd $user >/dev/null; then
26            adduser --system --force-badname $user
27        fi
28        # In the new gdm, the launcher is invoked as user gdm.
29        gdm_version="$(dpkg-query -W -f '${Version}' gdm)"
30        if dpkg --compare-versions "$gdm_version" ge '2.25.2~'; then
31            cat >>/etc/sudoers <<EOF
32### BEGIN debathena-kiosk
33# gdm can launch kiosk mode
34gdm ALL=NOPASSWD: /usr/lib/debathena-kiosk/launch-kiosk
35lightdm ALL=NOPASSWD: /usr/lib/debathena-kiosk/launch-kiosk
36### END debathena-kiosk
37EOF
38        fi
39    ;;
40
41    abort-upgrade|abort-remove|abort-deconfigure)
42    ;;
43
44    *)
45        echo "postinst called with unknown argument \`$1'" >&2
46        exit 1
47    ;;
48esac
49
50# dh_installdeb will replace this with shell code automatically
51# generated by other debhelper scripts.
52
53#DEBHELPER#
54
55exit 0
Note: See TracBrowser for help on using the repository browser.