[632040d] | 1 | #!/bin/sh |
---|
| 2 | # postinst script for gutenbach-server |
---|
| 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 | . /usr/share/debconf/confmodule |
---|
| 21 | |
---|
| 22 | case "$1" in |
---|
| 23 | configure|reconfigure) |
---|
| 24 | if [ ! -d /usr/lib/gutenbach/config ]; then |
---|
| 25 | mkdir /usr/lib/gutenbach/config |
---|
| 26 | fi |
---|
| 27 | |
---|
| 28 | db_get gutenbach-server/zephyrclass |
---|
| 29 | echo "$RET" > /usr/lib/gutenbach/config/zephyrclass |
---|
| 30 | db_get gutenbach-server/printername |
---|
| 31 | echo "$RET" > /usr/lib/gutenbach/config/printername |
---|
| 32 | db_get gutenbach-server/hostname |
---|
| 33 | echo "$RET" > /usr/lib/gutenbach/config/hostname |
---|
| 34 | |
---|
| 35 | chmod +x /usr/lib/gutenbach/inst/create-filter-config |
---|
| 36 | chmod +x /usr/lib/gutenbach/inst/cups-add-printer |
---|
| 37 | chmod +x /usr/lib/gutenbach/inst/cups-set-perms |
---|
| 38 | /usr/lib/gutenbach/inst/create-filter-config |
---|
| 39 | /usr/lib/gutenbach/inst/cups-add-printer |
---|
| 40 | /usr/lib/gutenbach/inst/cups-set-perms |
---|
| 41 | |
---|
| 42 | inaudio=$(groups lp | grep audio || true) |
---|
| 43 | if [ -z "$inaudio" ]; then |
---|
| 44 | adduser lp audio |
---|
| 45 | fi |
---|
| 46 | |
---|
[eafb5c5] | 47 | # enable cups-lpd |
---|
| 48 | update-inetd --add "printer stream tcp nowait lp /usr/lib/cups/daemon/cups-lpd cups-lpd -o document-format=application/octet-stream" |
---|
| 49 | echo "Restarting openbsd-inet..." |
---|
| 50 | service openbsd-inetd restart |
---|
| 51 | |
---|
[632040d] | 52 | db_stop |
---|
| 53 | ;; |
---|
| 54 | |
---|
| 55 | abort-upgrade|abort-remove|abort-deconfigure) |
---|
| 56 | ;; |
---|
| 57 | |
---|
| 58 | *) |
---|
| 59 | echo "postinst called with unknown argument \`$1'" >&2 |
---|
| 60 | exit 1 |
---|
| 61 | ;; |
---|
| 62 | esac |
---|
| 63 | |
---|
| 64 | # dh_installdeb will replace this with shell code automatically |
---|
| 65 | # generated by other debhelper scripts. |
---|
| 66 | |
---|
| 67 | #DEBHELPER# |
---|
| 68 | |
---|
| 69 | exit 0 |
---|