aboutsummaryrefslogtreecommitdiff
path: root/security/drupal4-ldap_integration/files/pkg-install.in
blob: e18d858c77e8a9435f4eb7f97e624120bae9ad34 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

PREFIX=%%PREFIX%%
CONF_FILES="%%CONF_FILES%%"
CONF_DIRS="%%CONF_DIRS%%"

case $2 in
POST-INSTALL)
	for cfgfile in "${CONF_FILES}"; do
		if [ ! -e ${PREFIX}/${cfgfile} ]; then
			cp ${PREFIX}/${cfgfile}-dist ${PREFIX}/${cfgfile}
		fi
	done
	;;
DEINSTALL)
	for cfgfile in "${CONF_FILES}"; do
		if cmp -s ${PREFIX}/${cfgfile} ${PREFIX}/${cfgfile}-dist ]; then
			rm ${PREFIX}/${cfgfile}
		fi
	done
	;;
POST-DEINSTALL)
	for cfgdir in "${CONF_DIRS}"; do
		rmdir ${PREFIX}/${cfgdir} 2> /dev/null || true
	done
	;;
esac