source: n4d-ldap/trunk/fuentes/debian/postinst @ 149

Last change on this file since 149 was 149, checked in by hectorgh, 4 years ago

adding project files

File size: 2.3 KB
Line 
1
2#!/bin/sh
3# postinst script for n4d-ldap
4#
5# see: dh_installdeb(1)
6
7set -e
8
9# summary of how this script can be called:
10#        * <postinst> `configure' <most-recently-configured-version>
11#        * <old-postinst> `abort-upgrade' <new version>
12#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
13#          <new-version>
14#        * <postinst> `abort-remove'
15#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
16#          <failed-install-package> <version> `removing'
17#          <conflicting-package> <version>
18# for details, see http://www.debian.org/doc/debian-policy/ or
19# the debian-policy package
20
21
22case "$1" in
23    configure)
24        if dpkg --compare-versions "$2" lt 0.20; then
25                cp /usr/share/n4d-ldap/one-shots/ldap-fix-epoptes /etc/n4d/one-shot/
26                invoke-rc.d n4d restart || true
27                fi
28               
29        if dpkg --compare-versions "$2" lt 0.21; then
30                echo "Fixing netadmin..."
31                cp /usr/share/n4d-ldap/one-shots/ldap-fix-netadmin /etc/n4d/one-shot/
32                invoke-rc.d n4d restart || true
33                fi
34        if dpkg --compare-versions "$2" lt 0.27; then
35               
36                cp /usr/share/n4d-ldap/one-shots/ldap_update.py /etc/n4d/one-shot/
37                invoke-rc.d n4d restart || true
38        fi
39        if dpkg --compare-versions "$2" lt 0.31; then
40                if [ -e '/var/lib/lliurex-folders/local/students' ]; then
41                        cp /usr/share/n4d/templates/folder/students /var/lib/lliurex-folders/local/
42                fi
43        fi
44
45        if dpkg --compare-versions "$2" lt 0.43; then
46                if [ -e '/var/lib/n4d/variables-dir/SRV_IP' ]; then
47                        echo "Adding roadmin ACLs..."
48                        cp /usr/share/n4d-ldap/one-shots/roadmin_acl.py /etc/n4d/one-shot/
49                        invoke-rc.d n4d restart || true
50                fi
51        fi
52       
53        if dpkg --compare-versions "$2" lt 0.44; then
54                if [ -e '/var/lib/n4d/variables-dir/SRV_IP' ]; then
55                        if [ ! -e "/var/lib/lliurex-folders/local/admins" ]; then
56                                echo "Enabling admins share..."
57                                cp /usr/share/n4d/templates/folder/admins /var/lib/lliurex-folders/local/
58                                cp /usr/share/n4d/templates/folder/netadmin /var/lib/lliurex-folders/local/
59                                invoke-rc.d n4d restart || true
60                        fi
61                fi
62        fi
63       
64
65        n4d-modules enable-plugin /etc/n4d/conf.d/SlapdManager || true
66
67
68        ;;
69
70
71
72    abort-upgrade|abort-remove|abort-deconfigure)
73    ;;
74
75    *)
76        echo "postinst called with unknown argument \`$1'" >&2
77        exit 1
78    ;;
79esac
80
81# dh_installdeb will replace this with shell code automatically
82# generated by other debhelper scripts.
83
84#DEBHELPER#
85
86exit 0
Note: See TracBrowser for help on using the repository browser.