File: sssd.postinst

package info (click to toggle)
sssd 1.8.4-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 13,628 kB
  • sloc: ansic: 99,910; xml: 21,353; sh: 12,272; python: 3,465; makefile: 1,492; sed: 16
file content (59 lines) | stat: -rw-r--r-- 1,694 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
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
55
56
57
58
59
#!/bin/sh
# postinst script for sssd
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <postinst> `configure' <most-recently-configured-version>
#        * <old-postinst> `abort-upgrade' <new version>
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
#          <new-version>
#        * <postinst> `abort-remove'
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
#          <failed-install-package> <version> `removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

case "$1" in
    configure)
    # Try to autogenerate a configuration file on package install
    if [ -z "$2" ] && [ ! -e /etc/sssd/sssd.conf ]; then
        /usr/lib/sssd/generate-config > /etc/sssd/sssd.conf.new
	if [ ! -s /etc/sssd/sssd.conf.new ] ; then
	    rm /etc/sssd/sssd.conf.new
	else
	    mv /etc/sssd/sssd.conf.new /etc/sssd/sssd.conf
            chmod 0600 /etc/sssd/sssd.conf
	fi
    fi
    # Fix configuration file on package upgrade
    if dpkg --compare-versions "$2" lt-nl 1.0.2-0ubuntu1; then
        /usr/lib/sssd/sssd/upgrade_config.py
    fi
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

invoke_failure() {
    # invoke-rc.d failed, likely because of a missing sssd.conf
    if [ ! -s /etc/sssd/sssd.conf ]; then
        echo "... because /etc/sssd/sssd.conf is not available yet"
    fi
}

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0