aboutsummaryrefslogtreecommitdiffstats
path: root/debian/postinst
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2008-08-12 00:50:11 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2008-08-12 00:50:11 +0100
commit5d3b4e8b7373416c0f48543a6a97cbb3ea591051 (patch)
treebea2126e3ee61d271981e321a9c62ff2e1b193de /debian/postinst
parent59c84c20ad924fedb9106599b96d2c48ff1cc316 (diff)
Fixed run-by-root problem (Debian bug 494656).1.2.1-2
Diffstat (limited to 'debian/postinst')
-rwxr-xr-xdebian/postinst7
1 files changed, 7 insertions, 0 deletions
diff --git a/debian/postinst b/debian/postinst
index 1363bfb6..4f5711ba 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -63,6 +63,13 @@ if [ -e /usr/share/bitlbee/help.upgrading ]; then
fi
fi
+if ! grep -qi '^User *= *' /etc/bitlbee/bitlbee.conf; then
+ echo 'Updating configuration file, enabling User-setting...'
+ if ! sed -i -e 's/# *User *= *.*/User = bitlbee/i' /etc/bitlbee/bitlbee.conf; then
+ echo 'Failed! BitlBee may run as root now, please check your configs.'
+ fi
+fi
+
if [ -n "$2" -a "$BITLBEE_UPGRADE_DONT_RESTART" != "1" ]; then
if which invoke-rc.d >/dev/null 2>&1; then
invoke-rc.d bitlbee restart