source: debian/postinst @ c78c032

Last change on this file since c78c032 was 19a8088, checked in by Wilmer van der Gaast <wilmer@…>, at 2007-07-05T23:36:48Z

Adding debian/ tree to the repository again. Updated it to include all
1.0.x versions and some other changes. Might soon start building snapshots
again. :-)

  • Property mode set to 100755
File size: 2.1 KB
Line 
1#!/bin/sh -e
2
3. /usr/share/debconf/confmodule
4
5db_get bitlbee/serveport
6PORT="$RET"
7
8CONFDIR=/var/lib/bitlbee/
9
10update-rc.d bitlbee defaults > /dev/null 2>&1
11
12## Load default option. Don't want to put this in debconf (yet?)
13BITLBEE_OPTS=-F
14BITLBEE_DISABLED=0
15BITLBEE_UPGRADE_DONT_RESTART=0
16[ -r /etc/default/bitlbee ] && source /etc/default/bitlbee
17
18if [ "$BITLBEE_DISABLED" = "0" ]; then
19        ## In case it's still there (if we're upgrading right now)
20        update-inetd --remove '.*/usr/sbin/bitlbee'
21fi
22
23cat<<EOF>/etc/default/bitlbee
24## /etc/default/bitlbee: Auto-generated/updated script.
25##
26## Don't edit this line, use dpkg-reconfigure bitlbee
27BITLBEE_PORT="$PORT"
28
29## Use single-process or forking daemon mode? Can't be changed from debconf,
30## but maintainer scripts will save your changes here.
31BITLBEE_OPTS="$BITLBEE_OPTS"
32
33## In case you want to stick with inetd mode (or if you just want to disable
34## the init scripts for some other reason), you can disable the init script
35## here. (Just set it to 1)
36BITLBEE_DISABLED=$BITLBEE_DISABLED
37
38## As a server operator, you can use the RESTART command to restart only the
39## master process while keeping all the child processes and their IPC
40## connections. By enabling this, the maintainer scripts won't restart
41## BitlBee during upgrades so you can restart the master process by hand.
42BITLBEE_UPGRADE_DONT_RESTART=$BITLBEE_UPGRADE_DONT_RESTART
43EOF
44
45## Bye-bye DebConf, we don't need you anymore.
46db_stop
47
48if [ -n "$2" -a "$BITLBEE_UPGRADE_DONT_RESTART" != "1" ]; then
49        /etc/init.d/bitlbee restart
50fi
51
52## If we're upgrading, we'll probably skip this next part
53if [ -d $CONFDIR ] && chown -R bitlbee $CONFDIR; then
54        echo 'BitlBee (probably) already installed, skipping user/configdir installation'
55        exit 0
56fi
57
58adduser --system --home /var/lib/bitlbee/ --disabled-login --disabled-password bitlbee
59chmod 700 /var/lib/bitlbee/
60
61## Can't do this in packaging phase: Don't know the UID yet. Access to
62## the file should be limited, now that it stores passwords.
63chmod 600 /etc/bitlbee/bitlbee.conf
64chown bitlbee /etc/bitlbee/bitlbee.conf
65
66if [ -z "$2" ]; then
67        /etc/init.d/bitlbee start
68fi
Note: See TracBrowser for help on using the repository browser.