#!/bin/sh # postinst script for n4d-ldap # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in configure) if dpkg --compare-versions "$2" lt 0.20; then cp /usr/share/n4d-ldap/one-shots/ldap-fix-epoptes /etc/n4d/one-shot/ invoke-rc.d n4d restart || true fi if dpkg --compare-versions "$2" lt 0.21; then echo "Fixing netadmin..." cp /usr/share/n4d-ldap/one-shots/ldap-fix-netadmin /etc/n4d/one-shot/ invoke-rc.d n4d restart || true fi if dpkg --compare-versions "$2" lt 0.27; then cp /usr/share/n4d-ldap/one-shots/ldap_update.py /etc/n4d/one-shot/ invoke-rc.d n4d restart || true fi if dpkg --compare-versions "$2" lt 0.31; then if [ -e '/var/lib/lliurex-folders/local/students' ]; then cp /usr/share/n4d/templates/folder/students /var/lib/lliurex-folders/local/ fi fi if dpkg --compare-versions "$2" lt 0.43; then if [ -e '/var/lib/n4d/variables-dir/SRV_IP' ]; then echo "Adding roadmin ACLs..." cp /usr/share/n4d-ldap/one-shots/roadmin_acl.py /etc/n4d/one-shot/ invoke-rc.d n4d restart || true fi fi if dpkg --compare-versions "$2" lt 0.44; then if [ -e '/var/lib/n4d/variables-dir/SRV_IP' ]; then if [ ! -e "/var/lib/lliurex-folders/local/admins" ]; then echo "Enabling admins share..." cp /usr/share/n4d/templates/folder/admins /var/lib/lliurex-folders/local/ cp /usr/share/n4d/templates/folder/netadmin /var/lib/lliurex-folders/local/ invoke-rc.d n4d restart || true fi fi fi n4d-modules enable-plugin /etc/n4d/conf.d/SlapdManager || true ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0