3 # koha-list -- List all Koha instances.
4 # Copyright 2010 Catalyst IT, Ltd
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
32 if grep '^[[:space:]]*Include /etc/koha/apache-shared-disable.conf' \
33 "/etc/apache2/sites-available/$instancename" > /dev/null
45 if [ -e /var/lib/koha/$instancename/email.enabled ]; then
54 find /etc/koha/sites -mindepth 1 -maxdepth 1\
55 -type d -printf '%f\n' | sort
63 for instance in $( get_instances ); do
66 show_instance_filter_email $instance $show_email;;
68 if is_enabled $instance; then
69 show_instance_filter_email $instance $show_email
72 if ! is_enabled $instance; then
73 show_instance_filter_email $instance $show_email
79 show_instance_filter_email()
88 if is_email_enabled $instancename; then
92 if ! is_email_enabled $instancename; then
102 if [ "$show" = "all" ]; then
105 die "Error: --enabled and --disabled are mutually exclusive."
113 if [ "$show_email" = "all" ]; then
114 show_email=$email_param
116 die "Error: --email and --noemail are mutually exclusive."
125 Lists Koha instances, optionally only those that are enabled or have
128 Usage: $scriptname [--enabled|--disabled] [--email|--noemail] [-h]
130 --enabled only show instances that are enabled
131 --disabled only show instances that are disabled
132 --email only show instances that have email enabled
133 --noemail only show instances that do not have email enabled
136 The filtering options can be combined, and you probably want to do this
137 (except --email and --noemail, or --enabled and --disabled, that's just silly.)
144 args=$(getopt -l enabled,disabled,email,noemail -o h -n $0 -- "$@")
151 --email) set_show_email "enabled" ;;
152 --noemail) set_show_email "disabled" ;;
153 --enabled) set_show "enabled" ;;
154 --disabled) set_show "disabled" ;;
160 show_instances $show $show_email