1 | #!/bin/sh |
---|
2 | # postinst script for debathena-cupsys-config |
---|
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 | #DEBHELPER# |
---|
22 | |
---|
23 | case "$1" in |
---|
24 | configure) |
---|
25 | # Handle Debian package name change from cupsys to cups. |
---|
26 | [ -e /etc/init.d/cups ] && rcname=cups || rcname=cupsys |
---|
27 | # Restart cupsd if it is running |
---|
28 | if /etc/init.d/$rcname status; then |
---|
29 | if hash invoke-rc.d; then |
---|
30 | invoke="invoke-rc.d $rcname" |
---|
31 | else |
---|
32 | invoke="/etc/init.d/$rcname" |
---|
33 | fi |
---|
34 | # Flush remote.cache to deal with things like changing the |
---|
35 | # server we BrowsePoll against. But don't do so if |
---|
36 | # policy-rc.d is going to prevent us from restarting cupsd |
---|
37 | # (for instance, if reactivate is installed and running; |
---|
38 | # in that case, the next logout will flush remote.cache and restart |
---|
39 | # cupsd anyway). |
---|
40 | if $invoke stop; then |
---|
41 | rm -f /var/cache/cups/remote.cache |
---|
42 | $invoke start |
---|
43 | fi |
---|
44 | fi |
---|
45 | ;; |
---|
46 | |
---|
47 | abort-upgrade|abort-remove|abort-deconfigure) |
---|
48 | ;; |
---|
49 | |
---|
50 | *) |
---|
51 | echo "postinst called with unknown argument \`$1'" >&2 |
---|
52 | exit 1 |
---|
53 | ;; |
---|
54 | esac |
---|