Lines 22-27
set -e
Link Here
|
22 |
usage="Usage: $0 [--create-db|--request-db|--populate-db|--use-db] \ |
22 |
usage="Usage: $0 [--create-db|--request-db|--populate-db|--use-db] \ |
23 |
[--marcflavor marc21|normarc|unimarc] \ |
23 |
[--marcflavor marc21|normarc|unimarc] \ |
24 |
[--zebralang en|es|fr|nb|ru|uk] \ |
24 |
[--zebralang en|es|fr|nb|ru|uk] \ |
|
|
25 |
[--auth-idx dom|grs1] [--biblio-idx dom|grs1] \ |
25 |
[--defaultsql /path/to/some.sql] \ |
26 |
[--defaultsql /path/to/some.sql] \ |
26 |
[--configfile /path/to/config] [--passwdfile /path/to/passwd] \ |
27 |
[--configfile /path/to/config] [--passwdfile /path/to/passwd] \ |
27 |
[--database database] [--adminuser n] instancename" |
28 |
[--database database] [--adminuser n] instancename" |
Lines 45-50
generate_config_file() {
Link Here
|
45 |
-e "s/__ZEBRA_PASS__/$zebrapwd/g" \ |
46 |
-e "s/__ZEBRA_PASS__/$zebrapwd/g" \ |
46 |
-e "s/__ZEBRA_MARC_FORMAT__/$ZEBRA_MARC_FORMAT/g" \ |
47 |
-e "s/__ZEBRA_MARC_FORMAT__/$ZEBRA_MARC_FORMAT/g" \ |
47 |
-e "s/__ZEBRA_LANGUAGE__/$ZEBRA_LANGUAGE/g" \ |
48 |
-e "s/__ZEBRA_LANGUAGE__/$ZEBRA_LANGUAGE/g" \ |
|
|
49 |
-e "s/__BIBLIO_INDEXING__/$BIBLIO_INDEXING/g" \ |
50 |
-e "s/__AUTHORITY_INDEXING__/$AUTHORITY_INDXING/g" \ |
48 |
-e "s/__DB_NAME__/$mysqldb/g" \ |
51 |
-e "s/__DB_NAME__/$mysqldb/g" \ |
49 |
-e "s/__DB_HOST__/$mysqlhost/g" \ |
52 |
-e "s/__DB_HOST__/$mysqlhost/g" \ |
50 |
-e "s/__DB_USER__/$mysqluser/g" \ |
53 |
-e "s/__DB_USER__/$mysqluser/g" \ |
Lines 75-80
getinstancemysqldatabase() {
Link Here
|
75 |
xmlstarlet sel -t -v 'yazgfs/config/database' "/etc/koha/sites/$1/koha-conf.xml" |
78 |
xmlstarlet sel -t -v 'yazgfs/config/database' "/etc/koha/sites/$1/koha-conf.xml" |
76 |
} |
79 |
} |
77 |
|
80 |
|
|
|
81 |
set_authority_indexing() |
82 |
{ |
83 |
indexing_mode=$1 |
84 |
|
85 |
case $indexing_mode in |
86 |
"grs1") |
87 |
AUTHORITY_INDEXING="" |
88 |
;; |
89 |
"dom") |
90 |
AUTHORITY_INDEXING="-dom" |
91 |
;; |
92 |
*) |
93 |
die "Error: '$indexing_mode' is not a valid indexing mode for authority records." |
94 |
;; |
95 |
esac |
96 |
} |
97 |
|
98 |
set_biblio_indexing() |
99 |
{ |
100 |
indexing_mode=$1 |
101 |
|
102 |
case $indexing_mode in |
103 |
"grs1") |
104 |
BIBLIO_INDEXING="" |
105 |
;; |
106 |
"dom") |
107 |
BIBLIO_INDEXING="-dom" |
108 |
;; |
109 |
*) |
110 |
die "Error: '$indexing_mode' is not a valid indexing mode for bibliographic records." |
111 |
;; |
112 |
esac |
113 |
} |
114 |
|
78 |
# Set defaults and read config file, if it exists. |
115 |
# Set defaults and read config file, if it exists. |
79 |
DOMAIN="" |
116 |
DOMAIN="" |
80 |
OPACPORT="80" |
117 |
OPACPORT="80" |
Lines 86-91
INTRASUFFIX=""
Link Here
|
86 |
DEFAULTSQL="" |
123 |
DEFAULTSQL="" |
87 |
ZEBRA_MARC_FORMAT="marc21" |
124 |
ZEBRA_MARC_FORMAT="marc21" |
88 |
ZEBRA_LANGUAGE="en" |
125 |
ZEBRA_LANGUAGE="en" |
|
|
126 |
BIBLIO_INDEXING="-dom" |
127 |
AUTHORITY_INDEXING="-dom" |
89 |
ADMINUSER="1" |
128 |
ADMINUSER="1" |
90 |
PASSWDFILE="/etc/koha/passwd" |
129 |
PASSWDFILE="/etc/koha/passwd" |
91 |
if [ -e /etc/koha/koha-sites.conf ] |
130 |
if [ -e /etc/koha/koha-sites.conf ] |
Lines 95-101
fi
Link Here
|
95 |
|
134 |
|
96 |
[ $# -ge 2 ] && [ $# -le 16 ] || die $usage |
135 |
[ $# -ge 2 ] && [ $# -le 16 ] || die $usage |
97 |
|
136 |
|
98 |
TEMP=`getopt -o crpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,marcflavor:,zebralang:,defaultsql:,configfile:,passwdfile:,database:,adminuser: \ |
137 |
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: \ |
99 |
-n "$0" -- "$@"` |
138 |
-n "$0" -- "$@"` |
100 |
|
139 |
|
101 |
# Note the quotes around `$TEMP': they are essential! |
140 |
# Note the quotes around `$TEMP': they are essential! |
Lines 115-120
while true ; do
Link Here
|
115 |
-u|--use-db) op=use ; shift ;; |
154 |
-u|--use-db) op=use ; shift ;; |
116 |
-m|--marcflavor) CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;; |
155 |
-m|--marcflavor) CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;; |
117 |
-l|--zebralang) CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;; |
156 |
-l|--zebralang) CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;; |
|
|
157 |
--auth-idx) set_authority_indexing "$2" ; shift 2 ;; |
158 |
--biblio-idx) set_biblio_indexing "$2" ; shift 2 ;; |
118 |
-d|--defaultsql) CLO_DEFAULTSQL="$2" ; shift 2 ;; |
159 |
-d|--defaultsql) CLO_DEFAULTSQL="$2" ; shift 2 ;; |
119 |
-f|--configfile) configfile="$2" ; shift 2 ;; |
160 |
-f|--configfile) configfile="$2" ; shift 2 ;; |
120 |
-s|--passwdfile) CLO_PASSWDFILE="$2" ; shift 2 ;; |
161 |
-s|--passwdfile) CLO_PASSWDFILE="$2" ; shift 2 ;; |
Lines 261-266
eof
Link Here
|
261 |
# Generate and install Zebra config files. |
302 |
# Generate and install Zebra config files. |
262 |
generate_config_file zebra-biblios-site.cfg.in \ |
303 |
generate_config_file zebra-biblios-site.cfg.in \ |
263 |
"/etc/koha/sites/$name/zebra-biblios.cfg" |
304 |
"/etc/koha/sites/$name/zebra-biblios.cfg" |
|
|
305 |
generate_config_file zebra-biblios-dom-site.cfg.in \ |
306 |
"/etc/koha/sites/$name/zebra-biblios-dom.cfg" |
264 |
generate_config_file zebra-authorities-site.cfg.in \ |
307 |
generate_config_file zebra-authorities-site.cfg.in \ |
265 |
"/etc/koha/sites/$name/zebra-authorities.cfg" |
308 |
"/etc/koha/sites/$name/zebra-authorities.cfg" |
266 |
generate_config_file zebra-authorities-dom-site.cfg.in \ |
309 |
generate_config_file zebra-authorities-dom-site.cfg.in \ |