30 lines
1015 B
Bash
30 lines
1015 B
Bash
#!/bin/bash
|
|
# Maintainer: #DEBHELPER#
|
|
|
|
. /usr/share/debconf/confmodule
|
|
|
|
EXAMPLEPORTALFILE=/usr/share/doc/liblemonldap-ng-portal-perl/examples/index.pl
|
|
PORTALFILE=/var/lib/lemonldap-ng/portal/index.pl
|
|
EXAMPLECLEANERFILE=/usr/share/doc/liblemonldap-ng-portal-perl/examples/scripts/purgeCentralCache
|
|
CLEANERFILE=/usr/share/lemonldap-ng/bin/purgeCentralCache
|
|
SESSIONSDIR=/var/lib/lemonldap-ng/sessions
|
|
|
|
if [ "$1" == "configure" ]
|
|
then
|
|
[ -e $PORTALFILE ] || \
|
|
perl -000 -pe 's/(configStorage\s*=>\s*){[^}]+}/$1\$Lemonldap::NG::Conf::configStorage/;
|
|
s#^use#\nrequire "/usr/share/lemonldap-ng/configStorage.pm";\nuse#m;' \
|
|
$EXAMPLEPORTALFILE >$PORTALFILE
|
|
[ -e $CLEANERFILE ] || \
|
|
perl -000 -pe 's/(configStorage\s*=>\s*){[^}]+}/$1\$Lemonldap::NG::Conf::configStorage/;
|
|
s#^use#\nrequire "/usr/share/lemonldap-ng/configStorage.pm";\nuse#m;' \
|
|
$EXAMPLECLEANERFILE >$CLEANERFILE
|
|
chmod +x $PORTALFILE
|
|
chmod +x $CLEANERFILE
|
|
chmod 770 $SESSIONSDIR;
|
|
chown www-data.www-data $SESSIONSDIR;
|
|
fi
|
|
|
|
|
|
|