File: bitlbee-common.postinst

package info (click to toggle)
bitlbee 3.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,392 kB
  • sloc: ansic: 29,135; xml: 2,282; sh: 905; makefile: 389; python: 221; perl: 41
file content (54 lines) | stat: -rw-r--r-- 1,550 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh

set -e

CONFDIR=/var/lib/bitlbee/

if [ -e /etc/default/bitlbee ]; then
   cat <<EOF >/etc/default/bitlbee
## /etc/default/bitlbee: Auto-generated/updated script.
##
## This file is deprecated and no longer used.
## Please edit /etc/bitlbee/bitlbee.conf instead
EOF

fi

## Restore the helpfile in case we weren't upgrading but just reconfiguring:
if [ -e /usr/share/bitlbee/help.upgrading ]; then
	if [ -e /usr/share/bitlbee/help.txt ]; then
		rm -f /usr/share/bitlbee/help.upgrading
	else
		mv /usr/share/bitlbee/help.upgrading /usr/share/bitlbee/help.txt
	fi
fi

if [ -n "$2" -a -x "/etc/init.d/bitlbee" ]; then
	invoke-rc.d bitlbee restart
fi

## If we're upgrading, we'll probably skip this next part
if [ -d $CONFDIR ] && chown -R bitlbee: $CONFDIR; then
	echo 'BitlBee (probably) already installed, skipping user/configdir installation'
else
	adduser --system --group --disabled-login --disabled-password --home /var/lib/bitlbee/ bitlbee
fi

if [ -d /var/lib/bitlbee ]; then
	chmod 700 /var/lib/bitlbee/
fi

## Can't do this in packaging phase: Don't know the UID yet. Access to
## the file should be limited, now that it stores passwords. Added
## --group later for a little more security, but have to see if I can
## apply this change to existing installations on upgrades. Will think
## about that later.
if getent group bitlbee > /dev/null; then
	chmod 640 /etc/bitlbee/bitlbee.conf
	chown root:bitlbee /etc/bitlbee/bitlbee.conf
else
	chmod 600 /etc/bitlbee/bitlbee.conf
	chown bitlbee /etc/bitlbee/bitlbee.conf
fi

#DEBHELPER#