View | Details | Raw Unified | Return to bug 11404
Collapse All | Expand All

(-)a/debian/scripts/koha-create (-5 / +10 lines)
Lines 257-267 while true ; do Link Here
257
            CLO_MEMCACHED_PREFIX="$2" ; shift 2;;
257
            CLO_MEMCACHED_PREFIX="$2" ; shift 2;;
258
        -m|--marcflavor)
258
        -m|--marcflavor)
259
            CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;;
259
            CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;;
260
    -l|--zebralang)
260
        -l|--zebralang)
261
            CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;;
261
            CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;;
262
    --auth-idx)
262
        --auth-idx)
263
            CLO_AUTHORITIES_INDEXING_MODE="$2" ; shift 2 ;;
263
            CLO_AUTHORITIES_INDEXING_MODE="$2" ; shift 2 ;;
264
    --biblio-idx)
264
        --biblio-idx)
265
            CLO_BIBLIOS_INDEXING_MODE="$2" ; shift 2 ;;
265
            CLO_BIBLIOS_INDEXING_MODE="$2" ; shift 2 ;;
266
        -d|--defaultsql)
266
        -d|--defaultsql)
267
            CLO_DEFAULTSQL="$2" ; shift 2 ;;
267
            CLO_DEFAULTSQL="$2" ; shift 2 ;;
Lines 437-444 eof Link Here
437
    fi #`
437
    fi #`
438
438
439
    # Generate and install Apache site-available file and log dir.
439
    # Generate and install Apache site-available file and log dir.
440
    generate_config_file apache-site.conf.in \
440
    if apache2ctl -v | grep -q "Server version: Apache/2.4"; then
441
        "/etc/apache2/sites-available/$name"
441
        generate_config_file apache-site.conf.in \
442
            "/etc/apache2/sites-available/$name.conf"
443
    else
444
        generate_config_file apache-site.conf.in \
445
            "/etc/apache2/sites-available/$name"
446
    fi
442
    mkdir "/var/log/koha/$name"
447
    mkdir "/var/log/koha/$name"
443
    chown "$username:$username" "/var/log/koha/$name"
448
    chown "$username:$username" "/var/log/koha/$name"
444
449
(-)a/debian/scripts/koha-disable (-2 / +12 lines)
Lines 34-46 warn() Link Here
34
is_enabled()
34
is_enabled()
35
{
35
{
36
    local instancename=$1
36
    local instancename=$1
37
    local instancefile="/etc/apache2/sites-available/$instancename"
38
39
    if apache2ctl -v | grep -q "Server version: Apache/2.4"; then
40
        instancefile="$instancefile.conf"
41
    fi
37
42
38
    if ! is_instance $instancename; then
43
    if ! is_instance $instancename; then
39
        return 1
44
        return 1
40
    fi
45
    fi
41
46
42
    if grep -q '^[[:space:]]*Include /etc/koha/apache-shared-disable.conf' \
47
    if grep -q '^[[:space:]]*Include /etc/koha/apache-shared-disable.conf' \
43
            "/etc/apache2/sites-available/$instancename" ; then
48
            "$instancefile" ; then
44
        return 1
49
        return 1
45
    else
50
    else
46
        return 0
51
        return 0
Lines 63-72 is_instance() Link Here
63
disable_instance()
68
disable_instance()
64
{
69
{
65
    local instancename=$1
70
    local instancename=$1
71
    local instancefile="/etc/apache2/sites-available/$instancename"
72
73
    if apache2ctl -v | grep -q "Server version: Apache/2.4"; then
74
        instancefile="$instancefile.conf"
75
    fi
66
76
67
    if is_enabled $instancename; then
77
    if is_enabled $instancename; then
68
        sed -i 's:^\s*#\(\s*Include /etc/koha/apache-shared-disable.conf\)$:\1:' \
78
        sed -i 's:^\s*#\(\s*Include /etc/koha/apache-shared-disable.conf\)$:\1:' \
69
          "/etc/apache2/sites-available/$instancename"
79
          "$instancefile"
70
        return 0
80
        return 0
71
    else
81
    else
72
        return 1
82
        return 1
(-)a/debian/scripts/koha-dump (-2 / +7 lines)
Lines 54-67 mysqldump --databases --host="$mysqlhost" \ Link Here
54
chown "root:$name-koha" "$dbdump"
54
chown "root:$name-koha" "$dbdump"
55
chmod g+r "$dbdump"
55
chmod g+r "$dbdump"
56
56
57
instancefile="$name"
58
if apache2ctl -v | grep -q "Server version: Apache/2.4"; then
59
    # Apache 2.4 needs the file have the sufix .conf
60
    instancefile="$instancefile.conf"
61
fi
57
62
58
# Dump configs, logs, etc.
63
# Dump configs, logs, etc.
59
metadump="$backupdir/$name-$date.tar.gz"
64
metadump="$backupdir/$name-$date.tar.gz"
60
echo "* configs, logs to $metadump"
65
echo "* configs, logs to $metadump"
61
tar -C / -czf "$metadump" \
66
tar -C / -czf "$metadump" \
62
    "etc/koha/sites/$name" \
67
    "etc/koha/sites/$name" \
63
    "etc/apache2/sites-available/$name" \
68
    "etc/apache2/sites-available/$instancefile" \
64
    "etc/apache2/sites-enabled/$name" \
69
    "etc/apache2/sites-enabled/$instancefile" \
65
    "var/lib/koha/$name" \
70
    "var/lib/koha/$name" \
66
    "var/log/koha/$name"
71
    "var/log/koha/$name"
67
72
(-)a/debian/scripts/koha-enable (-2 / +12 lines)
Lines 34-46 warn() Link Here
34
is_enabled()
34
is_enabled()
35
{
35
{
36
    local instancename=$1
36
    local instancename=$1
37
    local instancefile="/etc/apache2/sites-available/$instancename"
38
39
    if apache2ctl -v | grep -q "Server version: Apache/2.4"; then
40
        instancefile="$instancefile.conf"
41
    fi
37
42
38
    if ! is_instance $instancename; then
43
    if ! is_instance $instancename; then
39
        return 1
44
        return 1
40
    fi
45
    fi
41
46
42
    if grep -q '^[[:space:]]*Include /etc/koha/apache-shared-disable.conf' \
47
    if grep -q '^[[:space:]]*Include /etc/koha/apache-shared-disable.conf' \
43
            "/etc/apache2/sites-available/$instancename" ; then
48
            "$instancefile" ; then
44
        return 1
49
        return 1
45
    else
50
    else
46
        return 0
51
        return 0
Lines 63-72 is_instance() Link Here
63
enable_instance()
68
enable_instance()
64
{
69
{
65
    local instancename=$1
70
    local instancename=$1
71
    local instancefile="/etc/apache2/sites-available/$instancename"
72
73
    if apache2ctl -v | grep -q "Server version: Apache/2.4"; then
74
        instancefile="$instancefile.conf"
75
    fi
66
76
67
    if ! is_enabled $instancename; then
77
    if ! is_enabled $instancename; then
68
        sed -i 's:^\(\s*Include /etc/koha/apache-shared-disable.conf\)$:#\1:' \
78
        sed -i 's:^\(\s*Include /etc/koha/apache-shared-disable.conf\)$:#\1:' \
69
            "/etc/apache2/sites-available/$instancename"
79
            "$instancefile"
70
        return 0
80
        return 0
71
    else
81
    else
72
        return 1
82
        return 1
(-)a/debian/scripts/koha-list (-1 / +6 lines)
Lines 28-36 die() Link Here
28
is_enabled()
28
is_enabled()
29
{
29
{
30
    local instancename=$1
30
    local instancename=$1
31
    local instancefile="/etc/apache2/sites-available/$instancename"
32
33
    if apache2ctl -v | grep -q "Server version: Apache/2.4"; then
34
        instancefile="$instancefile.conf"
35
    fi
31
36
32
    if grep '^[[:space:]]*Include /etc/koha/apache-shared-disable.conf' \
37
    if grep '^[[:space:]]*Include /etc/koha/apache-shared-disable.conf' \
33
            "/etc/apache2/sites-available/$instancename" > /dev/null
38
            "$instancefile" > /dev/null
34
    then
39
    then
35
        return 1
40
        return 1
36
    else
41
    else
(-)a/debian/scripts/koha-remove (-2 / +8 lines)
Lines 68-75 eof Link Here
68
    
68
    
69
    # If the daemon is not running already, we don't want to fail this loop. So bin the result code if this fails.
69
    # If the daemon is not running already, we don't want to fail this loop. So bin the result code if this fails.
70
    koha-stop-zebra $name || /bin/true
70
    koha-stop-zebra $name || /bin/true
71
    [ -f "/etc/apache2/sites-available/$name" ]  && \
71
72
        rm "/etc/apache2/sites-available/$name"
72
    instancefile="$name"
73
    if apache2ctl -v | grep -q "Server version: Apache/2.4"; then
74
        instancefile="$instancefile.conf"
75
    fi
76
77
    [ -f "/etc/apache2/sites-available/$instancefile" ]  && \
78
        rm "/etc/apache2/sites-available/$instancefile"
73
    [ -f "/etc/koha/sites/$name/koha-conf.xml" ] && \
79
    [ -f "/etc/koha/sites/$name/koha-conf.xml" ] && \
74
        rm "/etc/koha/sites/$name/koha-conf.xml"
80
        rm "/etc/koha/sites/$name/koha-conf.xml"
75
    [ -f "/etc/koha/sites/$name/zebra-biblios.cfg" ] && \
81
    [ -f "/etc/koha/sites/$name/zebra-biblios.cfg" ] && \
(-)a/debian/scripts/koha-restart-zebra (-1 / +6 lines)
Lines 32-44 warn() Link Here
32
is_enabled()
32
is_enabled()
33
{
33
{
34
    local instancename=$1
34
    local instancename=$1
35
    local instancefile="/etc/apache2/sites-available/$instancename"
36
37
    if apache2ctl -v | grep -q "Server version: Apache/2.4"; then
38
        instancefile="$instancefile.conf"
39
    fi
35
40
36
    if ! is_instance $instancename; then
41
    if ! is_instance $instancename; then
37
        return 1
42
        return 1
38
    fi
43
    fi
39
44
40
    if grep -q '^[[:space:]]*Include /etc/koha/apache-shared-disable.conf' \
45
    if grep -q '^[[:space:]]*Include /etc/koha/apache-shared-disable.conf' \
41
            "/etc/apache2/sites-available/$instancename" ; then
46
            "$instancefile" ; then
42
        return 1
47
        return 1
43
    else
48
    else
44
        return 0
49
        return 0
(-)a/debian/scripts/koha-start-zebra (-1 / +6 lines)
Lines 32-44 warn() Link Here
32
is_enabled()
32
is_enabled()
33
{
33
{
34
    local instancename=$1
34
    local instancename=$1
35
    local instancefile="/etc/apache2/sites-available/$instancename"
36
37
    if apache2ctl -v | grep -q "Server version: Apache/2.4"; then
38
        instancefile="$instancefile.conf"
39
    fi
35
40
36
    if ! is_instance $instancename; then
41
    if ! is_instance $instancename; then
37
        return 1
42
        return 1
38
    fi
43
    fi
39
44
40
    if grep -q '^[[:space:]]*Include /etc/koha/apache-shared-disable.conf' \
45
    if grep -q '^[[:space:]]*Include /etc/koha/apache-shared-disable.conf' \
41
            "/etc/apache2/sites-available/$instancename" ; then
46
            "$instancefile" ; then
42
        return 1
47
        return 1
43
    else
48
    else
44
        return 0
49
        return 0
(-)a/debian/scripts/koha-stop-zebra (-2 / +6 lines)
Lines 32-44 warn() Link Here
32
is_enabled()
32
is_enabled()
33
{
33
{
34
    local instancename=$1
34
    local instancename=$1
35
    local instancefile="/etc/apache2/sites-available/$instancename"
36
37
    if apache2ctl -v | grep -q "Server version: Apache/2.4"; then
38
        instancefile="$instancefile.conf"
39
    fi
35
40
36
    if ! is_instance $instancename; then
41
    if ! is_instance $instancename; then
37
        return 1
42
        return 1
38
    fi
43
    fi
39
44
40
    if grep -q '^[[:space:]]*Include /etc/koha/apache-shared-disable.conf' \
45
    if grep -q '^[[:space:]]*Include /etc/koha/apache-shared-disable.conf' \
41
            "/etc/apache2/sites-available/$instancename" ; then
46
            "$instancefile" ; then
42
        return 1
47
        return 1
43
    else
48
    else
44
        return 0
49
        return 0
45
- 

Return to bug 11404