News for release v1.5.4
[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 # add default.xml if there are no enabled services
8 no_services=true
9 for f in /etc/pazpar2/services-enabled/*.xml; do
10         test -e $f && no_services=false
11 done
12 if ${no_services}; then
13         ln -sf ../services-available/default.xml \
14                 /etc/pazpar2/services-enabled/default.xml
15 fi
16 if [ -x "/etc/init.d/pazpar2" ]; then
17         update-rc.d pazpar2 defaults >/dev/null
18         if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
19                 invoke-rc.d pazpar2 start || exit $?
20         else
21                 /etc/init.d/pazpar2 start || exit $?
22         fi
23 fi
24 if [ -f "/etc/pazpar2/pazpar2.cfg" ]; then
25         echo "pazpar2.cfg is obsolete. Pazpar2 uses /etc/pazpar2/server.xml"
26 fi
27 exit 0