|
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-48
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 |
|
|
43 |
|
| 44 |
|
| 45 |
|
| 46 |
} |
46 |
} |
| 47 |
|
47 |
|
| 48 |
usage() |
48 |
usage() |
|
Lines 60-72
EOF
Link Here
|
| 60 |
[ $# -ge 1 ] || ( usage ; die "Missing instance name..." ) |
60 |
[ $# -ge 1 ] || ( usage ; die "Missing instance name..." ) |
| 61 |
|
61 |
|
| 62 |
restart_apache="no" |
62 |
restart_apache="no" |
| 63 |
|
|
|
| 64 |
for name in "$@" |
63 |
for name in "$@" |
| 65 |
do |
64 |
do |
| 66 |
if is_instance $name ; then |
65 |
if is_instance $name ; then |
| 67 |
RET=$(disable_instance $name) |
66 |
RET=$(disable_instance $name) |
| 68 |
if [ "$RET" = 0 ]; then |
67 |
if [ "$RET" = 0 ]; then |
| 69 |
restart_apache="yes" |
68 |
restart_apache="yes" |
| 70 |
elif [ "$RET" = 2 ]; then |
69 |
elif [ "$RET" = 2 ]; then |
| 71 |
warn "Error: Apache configuration file not present for instance $name." |
70 |
warn "Error: Apache configuration file not present for instance $name." |
| 72 |
else |
71 |
else |
|
Lines 82-84
if [ "$restart_apache" = "yes" ]; then
Link Here
|
| 82 |
fi |
81 |
fi |
| 83 |
|
82 |
|
| 84 |
exit 0 |
83 |
exit 0 |
| 85 |
- |
84 |
|