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