Revision 25577,
1.7 KB
checked in by jdreed, 12 years ago
(diff) |
In kiosk:
* Make postinst idempotent (Trac: 770)
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[23865] | 1 | #!/bin/sh |
---|
| 2 | # postinst script for debathena-kiosk |
---|
| 3 | # |
---|
| 4 | # see: dh_installdeb(1) |
---|
| 5 | |
---|
| 6 | set -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 | |
---|
| 21 | case "$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 |
---|
[24213] | 28 | # In the new gdm, the launcher is invoked as user gdm. |
---|
| 29 | gdm_version="$(dpkg-query -W -f '${Version}' gdm)" |
---|
[25577] | 30 | if dpkg --compare-versions "$gdm_version" ge '2.25.2~' && |
---|
| 31 | [ "$(perl -e 'BEGIN { $found=0; } $found = 1 if /^### BEGIN debathena-kiosk/../^### END debathena-kiosk/; END { print $found; }' /etc/sudoers)" = "0" ]; then |
---|
[24213] | 32 | cat >>/etc/sudoers <<EOF |
---|
| 33 | ### BEGIN debathena-kiosk |
---|
| 34 | # gdm can launch kiosk mode |
---|
| 35 | gdm ALL=NOPASSWD: /usr/lib/debathena-kiosk/launch-kiosk |
---|
[25557] | 36 | lightdm ALL=NOPASSWD: /usr/lib/debathena-kiosk/launch-kiosk |
---|
[24213] | 37 | ### END debathena-kiosk |
---|
| 38 | EOF |
---|
| 39 | fi |
---|
[23865] | 40 | ;; |
---|
| 41 | |
---|
| 42 | abort-upgrade|abort-remove|abort-deconfigure) |
---|
| 43 | ;; |
---|
| 44 | |
---|
| 45 | *) |
---|
| 46 | echo "postinst called with unknown argument \`$1'" >&2 |
---|
| 47 | exit 1 |
---|
| 48 | ;; |
---|
| 49 | esac |
---|
| 50 | |
---|
| 51 | # dh_installdeb will replace this with shell code automatically |
---|
| 52 | # generated by other debhelper scripts. |
---|
| 53 | |
---|
| 54 | #DEBHELPER# |
---|
| 55 | |
---|
| 56 | exit 0 |
---|
Note: See
TracBrowser
for help on using the repository browser.