Lines 176-189
enable_plack()
Link Here
|
176 |
local instancename=$1 |
176 |
local instancename=$1 |
177 |
local instancefile=$(get_apache_config_for "$instancename") |
177 |
local instancefile=$(get_apache_config_for "$instancename") |
178 |
|
178 |
|
179 |
if ! is_plack_enabled $instancename; then |
179 |
alreadyopac=0 |
180 |
# Uncomment the plack related lines for OPAC and intranet |
180 |
alreadyintra=0 |
|
|
181 |
failopac=0 |
182 |
failintra=0 |
183 |
if ! is_plack_enabled_opac $instancefile; then |
184 |
# Uncomment the plack related lines for OPAC |
181 |
sed -i 's:^\s*#\(\s*Include /etc/koha/apache-shared-opac-plack.conf\)$:\1:' "$instancefile" |
185 |
sed -i 's:^\s*#\(\s*Include /etc/koha/apache-shared-opac-plack.conf\)$:\1:' "$instancefile" |
|
|
186 |
if ! is_plack_enabled_opac $instancefile; then |
187 |
[ "${quiet}" != "yes" ] && warn "Plack not enabled for ${instancename} OPAC" |
188 |
failopac=1 |
189 |
else |
190 |
[ "${quiet}" != "yes" ] && warn "Plack enabled for ${instancename} OPAC" |
191 |
fi |
192 |
else |
193 |
[ "${quiet}" != "yes" ] && warn "Plack already enabled for ${instancename} OPAC" |
194 |
alreadyopac=1 |
195 |
fi |
196 |
if ! is_plack_enabled_intranet $instancefile; then |
197 |
# Uncomment the plack related lines for intranet |
182 |
sed -i 's:^\s*#\(\s*Include /etc/koha/apache-shared-intranet-plack.conf\)$:\1:' "$instancefile" |
198 |
sed -i 's:^\s*#\(\s*Include /etc/koha/apache-shared-intranet-plack.conf\)$:\1:' "$instancefile" |
183 |
[ "${quiet}" != "yes" ] && warn "Plack enabled for ${instancename}" |
199 |
if ! is_plack_enabled_intranet $instancefile; then |
|
|
200 |
[ "${quiet}" != "yes" ] && warn "Plack not enabled for ${instancename} Intranet" |
201 |
failintra=1 |
202 |
else |
203 |
[ "${quiet}" != "yes" ] && warn "Plack enabled for ${instancename} Intranet" |
204 |
fi |
205 |
else |
206 |
[ "${quiet}" != "yes" ] && warn "Plack already enabled for ${instancename} Intranet" |
207 |
alreadyintra=1 |
208 |
fi |
209 |
|
210 |
# Fail if it was already plack enabled. |
211 |
if [ $alreadyopac -eq 1 ] && [ $alreadyintra -eq 1 ] ; then |
212 |
return 1 |
213 |
elif [ "$alreadyopac" != "$alreadyintra" ]; then |
214 |
[ "${quiet}" != "yes" ] && warn "$instancename had a plack configuration error. Please confirm it is corrected." |
215 |
fi |
216 |
|
217 |
# Succeed if both or any plack were turned on. |
218 |
if [ $failopac -eq 0 ] || [ $failintra -eq 0 ] ; then |
184 |
return 0 |
219 |
return 0 |
185 |
else |
220 |
else |
186 |
[ "${quiet}" != "yes" ] && warn "Plack already enabled for ${instancename}" |
|
|
187 |
return 1 |
221 |
return 1 |
188 |
fi |
222 |
fi |
189 |
} |
223 |
} |
Lines 193-206
disable_plack()
Link Here
|
193 |
local instancename=$1 |
227 |
local instancename=$1 |
194 |
local instancefile=$(get_apache_config_for "$instancename") |
228 |
local instancefile=$(get_apache_config_for "$instancename") |
195 |
|
229 |
|
196 |
if is_plack_enabled $instancename; then |
230 |
alreadyopac=0 |
197 |
# Comment out the plack related lines for OPAC and intranet |
231 |
alreadyintra=0 |
|
|
232 |
failopac=0 |
233 |
failintra=0 |
234 |
if is_plack_enabled_opac $instancefile ; then |
235 |
# Comment the plack related lines for OPAC |
198 |
sed -i 's:^\(\s*Include /etc/koha/apache-shared-opac-plack.conf\)$:#\1:' "$instancefile" |
236 |
sed -i 's:^\(\s*Include /etc/koha/apache-shared-opac-plack.conf\)$:#\1:' "$instancefile" |
|
|
237 |
if is_plack_enabled_opac $instancefile ; then |
238 |
[ "${quiet}" != "yes" ] && warn "Plack not disabled for ${instancename} OPAC" |
239 |
failopac=1 |
240 |
else |
241 |
[ "${quiet}" != "yes" ] && warn "Plack disabled for ${instancename} OPAC" |
242 |
fi |
243 |
else |
244 |
[ "${quiet}" != "yes" ] && warn "Plack already disabled for ${instancename} OPAC" |
245 |
alreadyopac=1 |
246 |
fi |
247 |
if is_plack_enabled_intranet $instancefile; then |
248 |
# Comment the plack related lines for intranet |
199 |
sed -i 's:^\(\s*Include /etc/koha/apache-shared-intranet-plack.conf\)$:#\1:' "$instancefile" |
249 |
sed -i 's:^\(\s*Include /etc/koha/apache-shared-intranet-plack.conf\)$:#\1:' "$instancefile" |
200 |
[ "${quiet}" != "yes" ] && warn "Plack disabled for ${instancename}" |
250 |
if is_plack_enabled_intranet $instancefile; then |
|
|
251 |
[ "${quiet}" != "yes" ] && warn "Plack not disabled for ${instancename} Intranet" |
252 |
failintra=1 |
253 |
else |
254 |
[ "${quiet}" != "yes" ] && warn "Plack disabled for ${instancename} Intranet" |
255 |
fi |
256 |
else |
257 |
[ "${quiet}" != "yes" ] && warn "Plack already disabled for ${instancename} Intranet" |
258 |
alreadyintra=1 |
259 |
fi |
260 |
|
261 |
# Fail if it was already plack disabled. |
262 |
if [ $alreadyopac -eq 1 ] && [ $alreadyintra -eq 1 ] ; then |
263 |
return 1 |
264 |
elif [ "$alreadyopac" != "$alreadyintra" ]; then |
265 |
[ "${quiet}" != "yes" ] && warn "$instancename had a plack configuration error. Please confirm it is corrected." |
266 |
fi |
267 |
|
268 |
# Succeed if both or any plack were turned off. |
269 |
if [ $failopac -eq 0 ] || [ $failintra -eq 0 ] ; then |
201 |
return 0 |
270 |
return 0 |
202 |
else |
271 |
else |
203 |
[ "${quiet}" != "yes" ] && warn "Plack already disabled for ${instancename}" |
|
|
204 |
return 1 |
272 |
return 1 |
205 |
fi |
273 |
fi |
206 |
} |
274 |
} |
207 |
- |
|
|