Happy new year
[pazpar2-moved-to-github.git] / debian / pazpar2.postinst
1 #!/bin/sh
2 set -e
3
4 if [ "$1" != "configure" ]; then
5     exit 0
6 fi
7 for i in cf.xsl marc21.xsl pp2out-to-carrot2.xsl solr-pz2.xsl \
8  dads-pz2.xsl marc22.xsl primo-pz2.xsl tmarc.xsl danmarc2.xsl \
9  MarcXML2TurboMarc.xsl pz2-ourl-base.xsl unimarc.xsl dc.xsl \
10  oai_dc.xsl pz2-ourl-marc21.xsl usmarc.xsl dkabm.xsl opac_turbomarc.xsl \
11  pz2-solr.xsl marc21-ourl.xsl opac.xsl server-status-nagios.xsl ; do
12         dpkg-maintscript-helper rm_conffile /etc/pazpar2/$i 1.6.99.-1.indexdata -- "$@"
13 done
14
15 # add default.xml if there are no enabled services
16 no_services=true
17 for f in /etc/pazpar2/services-enabled/*.xml; do
18         test -e $f && no_services=false
19 done
20 if ${no_services}; then
21         ln -sf ../services-available/default.xml \
22                 /etc/pazpar2/services-enabled/default.xml
23 fi
24 if [ -x "/etc/init.d/pazpar2" ]; then
25         update-rc.d pazpar2 defaults >/dev/null
26         if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
27                 invoke-rc.d pazpar2 start || exit $?
28         else
29                 /etc/init.d/pazpar2 start || exit $?
30         fi
31 fi
32 if [ -f "/etc/pazpar2/pazpar2.cfg" ]; then
33         echo "pazpar2.cfg is obsolete. Pazpar2 uses /etc/pazpar2/server.xml"
34 fi
35 exit 0