File: postinst

package info (click to toggle)
lbcd 3.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,696 kB
  • ctags: 1,034
  • sloc: ansic: 10,747; sh: 1,815; perl: 482; makefile: 159
file content (24 lines) | stat: -rwxr-xr-x 760 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

set -e

# Add a user for the daemon to run as.
if ! getent passwd lbcd >/dev/null; then
    adduser --disabled-password --quiet --system --no-create-home \
	--gecos "Load Balancing Client Daemon" --group lbcd
fi

# Handle upgrades from versions supporting NO_START in /etc/default/lbcd.
# Convert this to a properly disabled configuration.  upstart does not support
# update-rc.d <service> disable, so upstart users will need to manually
# disable the daemon for now.
if [ "$1" = 'configure' ] && [ -f /etc/default/lbcd ] ; then
    if [ -n "$2" ] && dpkg --compare-versions "$2" lt 3.5.0 ; then
        . /etc/default/lbcd
        if [ "$NO_START" = 1 ] ; then
            update-rc.d lbcd disable >/dev/null 2>&1
        fi
    fi
fi

#DEBHELPER#