~ubuntu-branches/ubuntu/trusty/plptools/trusty

« back to all changes in this revision

Viewing changes to debian.orig/plptools.postinst

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2006-12-18 23:02:46 UTC
  • mfrom: (0.1.3 upstream) (2.1.1 etch)
  • Revision ID: james.westby@ubuntu.com-20061218230246-6urpwt87yt2z0s61
Tags: 0.15-1.2ubuntu1
* Re-sync with Debian.
* Re-add dh_iconcache in debian/rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
# postinst script for plptools
 
3
#
 
4
# see: dh_installdeb(1)
 
5
 
 
6
set -e
 
7
. /usr/share/debconf/confmodule
 
8
 
 
9
# summary of how this script can be called:
 
10
#        * <postinst> `configure' <most-recently-configured-version>
 
11
#        * <old-postinst> `abort-upgrade' <new version>
 
12
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
 
13
#          <new-version>
 
14
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
 
15
#          <failed-install-package> <version> `removing'
 
16
#          <conflicting-package> <version>
 
17
# for details, see /usr/share/doc/packaging-manual/
 
18
#
 
19
# quoting from the policy:
 
20
#     Any necessary prompting should almost always be confined to the
 
21
#     post-installation script, and should be protected with a conditional
 
22
#     so that unnecessary prompting doesn't happen if a package's
 
23
#     installation fails and the `postinst' is called with `abort-upgrade',
 
24
#     `abort-remove' or `abort-deconfigure'.
 
25
 
 
26
case "$1" in
 
27
        configure)
 
28
                START_NCPD=no
 
29
                START_PLPNFSD=no
 
30
                START_PLPPRINTD=no
 
31
                NCPD_ARGS=
 
32
                PLPNFSD_ARGS=
 
33
                PLPPRINTD_ARGS=
 
34
                FREM=
 
35
                db_get plptools/ncpd/start
 
36
                if [ "$RET" = "true" ] ; then
 
37
                        START_NCPD=yes
 
38
                        db_get plptools/ncpd/serial
 
39
                        if [ "$RET" != "/dev/ttyS0" ] ; then
 
40
                                NCPD_ARGS="$NCPD_ARGS -s $RET"
 
41
                        fi
 
42
                        db_get plptools/ncpd/listenat
 
43
                        case "$RET" in
 
44
                                127.0.0.1)
 
45
                                        ;;
 
46
                                127.0.0.1:7501)
 
47
                                        ;;
 
48
                                *)
 
49
                                        NCPD_ARGS="$NCPD_ARGS -p $RET"
 
50
                                        ;;
 
51
                        esac
 
52
                else
 
53
                        db_get plptools/frontends/remoteaddr
 
54
                        case "$RET" in
 
55
                                127.0.0.1)
 
56
                                        ;;
 
57
                                127.0.0.1:7501)
 
58
                                        ;;
 
59
                                *)
 
60
                                        FREM="-p $RET"
 
61
                                        ;;
 
62
                        esac
 
63
                fi
 
64
                db_get plptools/plpnfsd/start
 
65
                if [ "$RET" = "true" ] ; then
 
66
                        START_PLPNFSD=yes
 
67
                        PLPNFSD_ARGS="$FREM"
 
68
                fi
 
69
                db_get plptools/plpprintd/start
 
70
                if [ "$RET" = "true" ] ; then
 
71
                        START_PLPPRINTD=yes
 
72
                        PLPPRINTD_ARGS="$FREM"
 
73
                        db_get plptools/plpprintd/printqueue
 
74
                        if [ "$RET" != "psion" ] ; then
 
75
                                PLPPRINTD_ARGS="$PLPPRINTD_ARGS -s \"lpr -P$RET\""
 
76
                        fi
 
77
                fi
 
78
                cp /etc/plptools.conf /etc/plptools.conf.$$
 
79
                cat /etc/plptools.conf.$$ | sed \
 
80
                        -e "s@START_NCPD=.*@START_NCPD=$START_NCPD@" \
 
81
                        -e "s@START_PLPNFSD=.*@START_PLPNFSD=$START_PLPNFSD@" \
 
82
                        -e "s@START_PLPPRINTD=.*@START_PLPPRINTD=$START_PLPPRINTD@" \
 
83
                        -e "s@NCPD_ARGS=.*@NCPD_ARGS=\"$NCPD_ARGS\"@" \
 
84
                        -e "s@PLPNFSD_ARGS=.*@PLPNFSD_ARGS=\"$PLPNFSD_ARGS\"@" \
 
85
                        -e "s@PLPPRINTD_ARGS=.*@PLPPRINTD_ARGS=\"$PLPPRINTD_ARGS\"@" \
 
86
                        > /etc/plptools.conf \
 
87
                && rm -f /etc/plptools.conf.$$ \
 
88
                || mv /etc/plptools.conf.$$ /etc/plptools.conf || :
 
89
                db_get plptools/plpnfsd/suid
 
90
                if [ "$RET" = "true" ] ; then
 
91
                        chmod u+s /usr/sbin/plpnfsd
 
92
                else
 
93
                        chmod u-s /usr/sbin/plpnfsd
 
94
                fi
 
95
        ;;
 
96
 
 
97
        abort-upgrade|abort-remove|abort-deconfigure)
 
98
        ;;
 
99
 
 
100
        *)
 
101
                echo "postinst called with unknown argument \`$1'" >&2
 
102
                exit 0
 
103
        ;;
 
104
esac
 
105
 
 
106
# dh_installdeb will replace this with shell code automatically
 
107
# generated by other debhelper scripts.
 
108
 
 
109
#DEBHELPER#
 
110
 
 
111
db_stop
 
112
 
 
113
exit 0
 
114
 
 
115