Lines 17-23
Link Here
|
17 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 |
|
18 |
|
19 |
|
19 |
|
20 |
set -e |
20 |
set -e |
21 |
|
21 |
|
22 |
# include helper functions |
22 |
# include helper functions |
23 |
if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then |
23 |
if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then |
Lines 29-47
fi
Link Here
|
29 |
|
29 |
|
30 |
disable_instance() |
30 |
disable_instance() |
31 |
{ |
31 |
{ |
32 |
local site=$1 |
32 |
local instancename=$1 |
33 |
local instancefile=$(get_apache_config_for $site) |
33 |
local instancefile=$(get_apache_config_for "$instancename") |
34 |
|
34 |
|
35 |
if [ "$instancefile" = ""]; then |
35 |
if [ "$instancefile" = "" ]; then |
36 |
return 2 |
36 |
echo 2 |
37 |
fi |
37 |
elif is_enabled $instancename; then |
38 |
|
38 |
sed -i 's:^\s*#\(\s*Include /etc/koha/apache-shared-disable.conf\)$:\1:' "$instancefile" |
39 |
if is_enabled $instancename; then |
39 |
echo 0 |
40 |
sed -i 's:^\s*#\(\s*Include /etc/koha/apache-shared-disable.conf\)$:\1:' \ |
|
|
41 |
"$instancefile" |
42 |
return 0 |
43 |
else |
40 |
else |
44 |
return 1 |
41 |
echo 1 |
45 |
fi |
42 |
fi |
46 |
} |
43 |
} |
47 |
|
44 |
|
Lines 60-72
EOF
Link Here
|
60 |
[ $# -ge 1 ] || ( usage ; die "Missing instance name..." ) |
57 |
[ $# -ge 1 ] || ( usage ; die "Missing instance name..." ) |
61 |
|
58 |
|
62 |
restart_apache="no" |
59 |
restart_apache="no" |
63 |
|
|
|
64 |
for name in "$@" |
60 |
for name in "$@" |
65 |
do |
61 |
do |
66 |
if is_instance $name ; then |
62 |
if is_instance $name ; then |
67 |
RET=$(disable_instance $name) |
63 |
RET=$(disable_instance $name) |
68 |
if [ "$RET" = 0 ]; then |
64 |
if [ "$RET" = 0 ]; then |
69 |
restart_apache="yes" |
65 |
restart_apache="yes" |
70 |
elif [ "$RET" = 2 ]; then |
66 |
elif [ "$RET" = 2 ]; then |
71 |
warn "Error: Apache configuration file not present for instance $name." |
67 |
warn "Error: Apache configuration file not present for instance $name." |
72 |
else |
68 |
else |
Lines 82-84
if [ "$restart_apache" = "yes" ]; then
Link Here
|
82 |
fi |
78 |
fi |
83 |
|
79 |
|
84 |
exit 0 |
80 |
exit 0 |
85 |
- |
81 |
|