diff options
author | Sven Moritz Hallberg <pesco@khjk.org> | 2009-03-12 20:33:28 +0100 |
---|---|---|
committer | Sven Moritz Hallberg <pesco@khjk.org> | 2009-03-12 20:33:28 +0100 |
commit | 673a54c5a78afd1dd41b4cd8811df5ab65042583 (patch) | |
tree | bffaa961139ac2be20f0875ef0ed37c87d6b18a9 /debian/postinst | |
parent | 823de9d44f262ea2364ac8ec6a1e18e0f7dab658 (diff) | |
parent | 9e768da723b4a770967efa0d4dcaf58ccef8917f (diff) |
pretty blind try at merging in the latest trunk
Diffstat (limited to 'debian/postinst')
-rwxr-xr-x | debian/postinst | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/debian/postinst b/debian/postinst index 80249bfe..db324b65 100755 --- a/debian/postinst +++ b/debian/postinst @@ -63,12 +63,23 @@ 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 - /etc/init.d/bitlbee restart + if which invoke-rc.d >/dev/null 2>&1; then + invoke-rc.d bitlbee restart + else + /etc/init.d/bitlbee restart + fi fi ## If we're upgrading, we'll probably skip this next part -if [ -d $CONFDIR ] && chown -R bitlbee $CONFDIR; then +if [ -d $CONFDIR ] && chown -R bitlbee: $CONFDIR; then echo 'BitlBee (probably) already installed, skipping user/configdir installation' exit 0 fi @@ -90,5 +101,9 @@ else fi if [ -z "$2" ]; then - /etc/init.d/bitlbee start + if which invoke-rc.d >/dev/null 2>&1; then + invoke-rc.d bitlbee start + else + /etc/init.d/bitlbee start + fi fi |