Commit 6774c2bb authored by Yadd's avatar Yadd
Browse files

Migration script for local files

parent 033a613d
......@@ -6,19 +6,25 @@ set -e
. /usr/share/debconf/confmodule
FIRSTCONFFILE=/var/lib/lemonldap-ng/conf/lmConf-1
CONFDIR=/etc/lemonldap-ng
if [ "$1" == "configure" ]
then
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
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
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
#perl -000 -i -pe "s#^(globalStorageOptions\\n\\s+)'[^\\n]*?'\$#\${1}\'\\\$data1 = {&39;Directory&39; => &39;/var/lib/lemonldap-ng/sessions/&39;,&39;LockDirectory&39; => &39;/var/lib/lemonldap-ng/sessions/lock/&39;};'#m" $FIRSTCONFFILE
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
if perl -e 'exit 1 if(qq('$2')!~/^0\.9/)' ; then
if [ -e $CONFDIR/storage.conf -o -e $CONFDIR/apply.conf -o -e $CONFDIR/apps-list.xml ] ; then
# Run migration script
/usr/share/lemonldap-ng/bin/lmMigrateConfFiles2ini 2>&1 > /dev/null || :
fi
fi
fi
exit 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment