2007-05-01 16:53:26 +02:00
|
|
|
#!/bin/bash
|
|
|
|
# Maintainer: #DEBHELPER#
|
|
|
|
|
2008-11-11 16:21:31 +01:00
|
|
|
set -e
|
|
|
|
|
2007-05-01 16:53:26 +02:00
|
|
|
. /usr/share/debconf/confmodule
|
|
|
|
|
|
|
|
FIRSTCONFFILE=/var/lib/lemonldap-ng/conf/lmConf-1
|
2010-11-30 21:59:42 +01:00
|
|
|
CONFDIR=/etc/lemonldap-ng
|
2012-02-20 17:06:23 +01:00
|
|
|
SESSIONSDIR=/var/lib/lemonldap-ng/sessions
|
2007-05-01 16:53:26 +02:00
|
|
|
|
|
|
|
if [ "$1" == "configure" ]
|
|
|
|
then
|
2012-02-20 17:06:23 +01:00
|
|
|
chmod 770 $SESSIONSDIR
|
|
|
|
chmod 770 $SESSIONSDIR/lock
|
|
|
|
chown -R www-data:www-data $SESSIONSDIR
|
2010-11-30 21:59:42 +01:00
|
|
|
chown -R www-data:www-data /var/lib/lemonldap-ng/conf
|
|
|
|
chmod 750 /var/lib/lemonldap-ng/conf
|
|
|
|
chmod 640 /var/lib/lemonldap-ng/conf/*
|
|
|
|
chgrp www-data /etc/lemonldap-ng/lemonldap-ng.ini
|
|
|
|
chmod 640 /etc/lemonldap-ng/lemonldap-ng.ini
|
2007-05-01 16:53:26 +02:00
|
|
|
|
2010-11-30 21:59:42 +01:00
|
|
|
for i in domain ldapServer ldapPort ldapBase managerDn managerPassword portal; do
|
|
|
|
db_get liblemonldap-ng-conf-perl/$i || true
|
|
|
|
perl -000 -i -pe "s#^$i(\\n\\s+)('?)[^\\n]*?('?)\$#$i\${1}\${2}$RET\${3}#m" $FIRSTCONFFILE
|
|
|
|
done
|
2011-02-25 10:21:40 +01:00
|
|
|
testversion=`echo $2|sed -e 's/^0\.9.*$/X/'`
|
|
|
|
if [ "$testversion" = "X" ]; then
|
2010-11-30 21:59:42 +01:00
|
|
|
if [ -e $CONFDIR/storage.conf -o -e $CONFDIR/apply.conf -o -e $CONFDIR/apps-list.xml ] ; then
|
2010-12-01 06:41:51 +01:00
|
|
|
db_get liblemonldap-ng-conf-perl/migrate
|
|
|
|
if [ "$RET" ]; then
|
|
|
|
# Run migration script
|
|
|
|
/usr/share/lemonldap-ng/bin/lmMigrateConfFiles2ini 2>&1 > /dev/null || :
|
|
|
|
fi
|
2010-11-30 21:59:42 +01:00
|
|
|
fi
|
|
|
|
fi
|
2007-05-01 16:53:26 +02:00
|
|
|
fi
|
|
|
|
exit 0
|