Lines 61-66
generate_config_file() {
Link Here
|
61 |
-e "s/__UNIXUSER__/$username/g" \ |
61 |
-e "s/__UNIXUSER__/$username/g" \ |
62 |
-e "s/__UNIXGROUP__/$username/g" \ |
62 |
-e "s/__UNIXGROUP__/$username/g" \ |
63 |
-e "s/__PLUGINS_DIR__/\/var\/lib\/koha\/$name\/plugins/g" \ |
63 |
-e "s/__PLUGINS_DIR__/\/var\/lib\/koha\/$name\/plugins/g" \ |
|
|
64 |
-e "s/__MEMCACHED_NAMESPACE__/$MEMCACHED_NAMESPACE/g" \ |
65 |
-e "s/__MEMCACHED_SERVERS__/$MEMCACHED_SERVERS/g" \ |
64 |
"/etc/koha/$1" > "$2" |
66 |
"/etc/koha/$1" > "$2" |
65 |
|
67 |
|
66 |
} |
68 |
} |
Lines 154-159
EOF`
Link Here
|
154 |
esac |
156 |
esac |
155 |
} |
157 |
} |
156 |
|
158 |
|
|
|
159 |
|
160 |
set_memcached() |
161 |
{ |
162 |
local instance="$1" |
163 |
|
164 |
if [ "$CLO_MEMCACHED_SERVERS" != "" ]; then |
165 |
MEMCACHED_SERVERS=$CLO_MEMCACHED_SERVERS |
166 |
else |
167 |
MEMCACHED_SERVERS=$DEFAULT_MEMCACHED_SERVERS |
168 |
fi |
169 |
|
170 |
if [ "$CLO_MEMCACHED_NAMESPACE" != "" ]; then |
171 |
MEMCACHED_NAMESPACE=$CLO_MEMCACHED_NAMESPACE |
172 |
else |
173 |
# default |
174 |
MEMCACHED_NAMESPACE="koha_$instance" |
175 |
fi |
176 |
|
177 |
} |
178 |
|
157 |
# Set defaults and read config file, if it exists. |
179 |
# Set defaults and read config file, if it exists. |
158 |
DOMAIN="" |
180 |
DOMAIN="" |
159 |
OPACPORT="80" |
181 |
OPACPORT="80" |
Lines 167-172
ZEBRA_MARC_FORMAT="marc21"
Link Here
|
167 |
ZEBRA_LANGUAGE="en" |
189 |
ZEBRA_LANGUAGE="en" |
168 |
ADMINUSER="1" |
190 |
ADMINUSER="1" |
169 |
PASSWDFILE="/etc/koha/passwd" |
191 |
PASSWDFILE="/etc/koha/passwd" |
|
|
192 |
USE_MEMCACHED="no" |
193 |
MEMCACHED_SERVERS="" |
194 |
MEMCACHED_NAMESPACE="" |
195 |
DEFAULT_MEMCACHED_SERVERS="127.0.0.1:11211" |
170 |
|
196 |
|
171 |
# Indexing mode variables (default is DOM) |
197 |
# Indexing mode variables (default is DOM) |
172 |
BIBLIOS_INDEXING_MODE="dom" |
198 |
BIBLIOS_INDEXING_MODE="dom" |
Lines 184-190
fi
Link Here
|
184 |
|
210 |
|
185 |
[ $# -ge 2 ] && [ $# -le 16 ] || die $usage |
211 |
[ $# -ge 2 ] && [ $# -le 16 ] || die $usage |
186 |
|
212 |
|
187 |
TEMP=`getopt -o crpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,marcflavor:,auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,database:,adminuser: \ |
213 |
TEMP=`getopt -o crpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,use-memcached,marcflavor:,auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,database:,adminuser:,memcached-servers:,memcached-namespace:, \ |
188 |
-n "$0" -- "$@"` |
214 |
-n "$0" -- "$@"` |
189 |
|
215 |
|
190 |
# Note the quotes around `$TEMP': they are essential! |
216 |
# Note the quotes around `$TEMP': they are essential! |
Lines 197-202
CLO_DEFAULTSQL=""
Link Here
|
197 |
CLO_ADMINUSER="" |
223 |
CLO_ADMINUSER="" |
198 |
CLO_BIBLIOS_INDEXING_MODE="" |
224 |
CLO_BIBLIOS_INDEXING_MODE="" |
199 |
CLO_AUTHORITIES_INDEXING_MODE="" |
225 |
CLO_AUTHORITIES_INDEXING_MODE="" |
|
|
226 |
CLO_MEMCACHED_SERVERS="" |
227 |
CLO_MEMCACHED_NAMESPACE="" |
200 |
|
228 |
|
201 |
|
229 |
|
202 |
while true ; do |
230 |
while true ; do |
Lines 204-210
while true ; do
Link Here
|
204 |
-c|--create-db) op=create ; shift ;; |
232 |
-c|--create-db) op=create ; shift ;; |
205 |
-r|--request-db) op=request ; shift ;; |
233 |
-r|--request-db) op=request ; shift ;; |
206 |
-p|--populate-db) op=populate ; shift ;; |
234 |
-p|--populate-db) op=populate ; shift ;; |
207 |
-u|--use-db) op=use ; shift ;; |
235 |
-u|--use-db) op=use ; shift ;; |
|
|
236 |
--use-memcached) |
237 |
USE_MEMCACHED="yes" |
238 |
shift ;; |
239 |
--memcached-servers) |
240 |
CLO_MEMCACHED_SERVERS="$2" |
241 |
shift 2 ;; |
242 |
--memcached-namespace) |
243 |
CLO_MEMCACHED_NAMESPACE="$2" |
244 |
shift 2;; |
208 |
-m|--marcflavor) CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;; |
245 |
-m|--marcflavor) CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;; |
209 |
-l|--zebralang) CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;; |
246 |
-l|--zebralang) CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;; |
210 |
--auth-idx) CLO_AUTHORITIES_INDEXING_MODE="$2" ; shift 2 ;; |
247 |
--auth-idx) CLO_AUTHORITIES_INDEXING_MODE="$2" ; shift 2 ;; |
Lines 267-272
set_authorities_indexing_mode $AUTHORITIES_INDEXING_MODE $ZEBRA_MARC_FORMAT
Link Here
|
267 |
|
304 |
|
268 |
name="$1" |
305 |
name="$1" |
269 |
|
306 |
|
|
|
307 |
if [ "$USE_MEMCACHED" = "yes" ]; then |
308 |
set_memcached $name |
309 |
fi |
310 |
|
270 |
opacdomain="$OPACPREFIX$name$OPACSUFFIX$DOMAIN" |
311 |
opacdomain="$OPACPREFIX$name$OPACSUFFIX$DOMAIN" |
271 |
intradomain="$INTRAPREFIX$name$INTRASUFFIX$DOMAIN" |
312 |
intradomain="$INTRAPREFIX$name$INTRASUFFIX$DOMAIN" |
272 |
|
313 |
|