Bug 26265: (QA follow-up) Remove g option from regex, add few dirs
[koha-equinox.git] / debian / koha-common.config
1 #!/bin/sh
2
3 # koha-common.config - ensures that debconf stuff is all handled properly
4 #
5 # Copyright 2011  Catalyst IT, Ltd
6
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16
17 # You should have received a copy of the GNU General Public License
18 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
20 set -e
21
22 . /usr/share/debconf/confmodule
23
24 CONFIGFILE=/etc/koha/koha-common.conf
25
26 if [ -e $CONFIGFILE ]; then
27     . $CONFIGFILE || true
28     # Put the current values into debconf
29     UPDATE="true"
30     if [ "$AUTOMATIC_TRANSLATIONS_UPDATE" = "no" ] ; then
31         UPDATE="false"
32     fi
33     db_set koha-common/automatically-update-translations "$UPDATE"
34 else
35     # True is the default
36     db_set koha-common/automatically-update-translations true
37 fi
38
39 if dpkg --compare-versions "$2" lt-nl 3.4 ; then
40     db_input high koha-common/3.2-3.4-upgrade-notice || true
41 fi
42
43 db_input medium koha-common/automatically-update-translations || true
44
45 # Determine if we should ask the user about upgrading - there's no point
46 # if this is a fresh install anyway.
47 if [ -e /usr/sbin/koha-list ]; then
48     RENAME_APACHE_FILES="no"
49     for vhost in $(koha-list); do
50         if [ -f "/etc/apache2/sites-available/$vhost" ] && \
51            [ ! -f "/etc/apache2/sites-available/$vhost.conf" ]; then
52            RENAME_APACHE_FILES="yes"
53            break # at least one, trigger renaming
54         fi
55     done
56     if [ "$RENAME_APACHE_FILES" = "yes" ]; then
57         db_input high koha-common/rename-apache-vhost-files || true
58     fi
59 fi
60
61 db_go || true
62