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

(-)a/debian/scripts/koha-plack (-3 / +7 lines)
Lines 144-152 enable_plack() Link Here
144
    local instancefile=$(get_apache_config_for "$instancename")
144
    local instancefile=$(get_apache_config_for "$instancename")
145
145
146
    if ! is_plack_enabled $instancename; then
146
    if ! is_plack_enabled $instancename; then
147
        # Uncomment the plack related lines for OPAC and intranet
147
        # Define the instance name and add the plack related lines for OPAC and intranet
148
        sed -i 's:^\s*#\(\s*Include /etc/koha/apache-shared-opac-plack.conf\)$:\1:' "$instancefile"
148
        sed -i "s:^\(\s*\)\(Include /etc/koha/apache-shared-opac.conf\):\1\2\n# Generated by koha-plack script -- add plack-related stuff\n\1Define instance $instancename\n\1Include /etc/koha/apache-shared-opac-plack.conf:" "$instancefile"
149
        sed -i 's:^\s*#\(\s*Include /etc/koha/apache-shared-intranet-plack.conf\)$:\1:' "$instancefile"
149
        sed -i "s:^\(\s*\)\(Include /etc/koha/apache-shared-intranet.conf\):\1\2\n# Generated by koha-plack script -- add plack-related stuff\n\1Define instance $instancename\n\1Include /etc/koha/apache-shared-intranet-plack.conf:" "$instancefile"
150
        [ "${quiet}" != "yes" ] && warn "Plack enabled for ${instancename}"
150
        [ "${quiet}" != "yes" ] && warn "Plack enabled for ${instancename}"
151
        return 0
151
        return 0
152
    else
152
    else
Lines 161-167 disable_plack() Link Here
161
    local instancefile=$(get_apache_config_for "$instancename")
161
    local instancefile=$(get_apache_config_for "$instancename")
162
162
163
    if is_plack_enabled $instancename; then
163
    if is_plack_enabled $instancename; then
164
        # Remove the plack related lines for OPAC and intranet
165
        perl -0777 -i -pe "s:# Generated by koha-plack script -- add plack-related stuff\n\s*Define instance $instancename\n\s*Include /etc/koha/apache-shared-opac-plack.conf::" "$instancefile"
166
        perl -0777 -i -pe "s:# Generated by koha-plack script -- add plack-related stuff\n\s*Define instance $instancename\n\s*Include /etc/koha/apache-shared-intranet-plack.conf::" "$instancefile"
164
        # Comment out the plack related lines for OPAC and intranet
167
        # Comment out the plack related lines for OPAC and intranet
168
        # (keep these lines in case plack was enabled with the previous method)
165
        sed -i 's:^\(\s*Include /etc/koha/apache-shared-opac-plack.conf\)$:#\1:' "$instancefile"
169
        sed -i 's:^\(\s*Include /etc/koha/apache-shared-opac-plack.conf\)$:#\1:' "$instancefile"
166
        sed -i 's:^\(\s*Include /etc/koha/apache-shared-intranet-plack.conf\)$:#\1:' "$instancefile"
170
        sed -i 's:^\(\s*Include /etc/koha/apache-shared-intranet-plack.conf\)$:#\1:' "$instancefile"
167
        [ "${quiet}" != "yes" ] && warn "Plack disabled for ${instancename}"
171
        [ "${quiet}" != "yes" ] && warn "Plack disabled for ${instancename}"

Return to bug 15695