[23287] | 1 | #!/bin/sh |
---|
[24528] | 2 | # postinst script for debathena-reactivate |
---|
[23287] | 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 | |
---|
[24367] | 20 | . /usr/lib/debathena-cupsys-config/restart-cups.sh |
---|
[24028] | 21 | |
---|
[25727] | 22 | if dpkg-maintscript-helper supports rm_conffile 2> /dev/null; then |
---|
| 23 | dpkg-maintscript-helper rm_conffile /etc/athena/sudo-error 2.0.39 -- "$@" |
---|
| 24 | dpkg-maintscript-helper rm_conffile /etc/athena/su-error 2.0.39 -- "$@" |
---|
| 25 | else |
---|
| 26 | # From http://wiki.debian.org/DpkgConffileHandling |
---|
| 27 | rm_conffile() { |
---|
| 28 | local PKGNAME="$1" # Unused |
---|
| 29 | local CONFFILE="$2" |
---|
| 30 | if [ -f "$CONFFILE".dpkg-del ]; then |
---|
| 31 | rm -f "$CONFFILE".dpkg-del |
---|
| 32 | fi |
---|
| 33 | } |
---|
| 34 | case "$1" in |
---|
| 35 | configure) |
---|
| 36 | if dpkg --compare-versions "$2" le-nl 2.0.39; then |
---|
| 37 | rm_conffile debathena-reactivate "/etc/athena/sudo-error" |
---|
| 38 | rm_conffile debathena-reactivate "/etc/athena/su-error" |
---|
| 39 | fi |
---|
| 40 | esac |
---|
| 41 | fi |
---|
[24367] | 42 | |
---|
[23287] | 43 | case "$1" in |
---|
| 44 | configure) |
---|
| 45 | # Users logging in will be added to several different |
---|
| 46 | # groups. Make sure they all exist. |
---|
[24125] | 47 | for group in $(sed -ne 's/^addgroups="\(.*\)"/\1/p' /etc/gdm/Xsession.debathena); do |
---|
[23287] | 48 | getent group "$group" >/dev/null || addgroup --system "$group" |
---|
| 49 | done |
---|
[25755] | 50 | # Files in sudoers.d need to be chmod 0440 |
---|
| 51 | chmod 0440 /etc/sudoers.d/debathena-reactivate-sudoers |
---|
[23789] | 52 | |
---|
[24083] | 53 | if dpkg --compare-versions "$2" lt 1.25.5~ && \ |
---|
| 54 | dpkg --compare-versions "$2" ge 1.25.2; then |
---|
| 55 | ln -nsf su.debathena /etc/pam.d/su |
---|
[24082] | 56 | fi |
---|
[25401] | 57 | if dpkg --compare-versions "$2" lt 2.0.26~ && \ |
---|
[24340] | 58 | [ -x /usr/share/update-notifier/notify-reboot-required ]; then |
---|
| 59 | /usr/share/update-notifier/notify-reboot-required |
---|
| 60 | fi |
---|
| 61 | |
---|
[24196] | 62 | # Make printing suck less |
---|
[24367] | 63 | restart_cups |
---|
[23287] | 64 | ;; |
---|
| 65 | |
---|
| 66 | abort-upgrade|abort-remove|abort-deconfigure) |
---|
| 67 | ;; |
---|
| 68 | |
---|
| 69 | *) |
---|
| 70 | echo "postinst called with unknown argument \`$1'" >&2 |
---|
| 71 | exit 1 |
---|
| 72 | ;; |
---|
| 73 | esac |
---|
| 74 | |
---|
| 75 | # dh_installdeb will replace this with shell code automatically |
---|
| 76 | # generated by other debhelper scripts. |
---|
| 77 | |
---|
| 78 | #DEBHELPER# |
---|
| 79 | |
---|
| 80 | exit 0 |
---|
| 81 | |
---|
| 82 | |
---|