View | Details | Raw Unified | Return to bug 11509
Collapse All | Expand All

(-)a/debian/scripts/koha-create (-17 / +51 lines)
Lines 19-33 Link Here
19
19
20
set -e
20
set -e
21
21
22
usage="Usage: $0 [--create-db|--request-db|--populate-db|--use-db] \
22
usage()
23
    [--marcflavor marc21|normarc|unimarc] \
23
{
24
    [--zebralang en|es|fr|nb|ru|uk] \
24
    local scriptname=$0
25
    [--auth-idx dom|grs1] [--biblio-idx dom|grs1] \
25
    cat <<EOF
26
    [--use-memcached] \
26
27
    [--memcached-servers server:port] [--memcached-prefix prefix] \
27
Creates new Koha instances.
28
    [--defaultsql /path/to/some.sql] \
28
29
    [--configfile /path/to/config] [--passwdfile /path/to/passwd] \
29
Usage:
30
    [--database database] [--adminuser n] instancename"
30
31
  $scriptname [db usage mode] [options] instancename"
32
33
DB usage mode:
34
  --create-db               Create a new database on localhost. (default).
35
  --request-db              Creates a instancename-db-request.txt file where
36
                            you adjust your DB settings and re-run with --populate-db.
37
  --populate-db             Finish the installation you started with --request-db after
38
                            you adjusted the instancename-db-request.txt file.
39
  --use-db                  Use this option if you already created and populated you DB.
40
41
Options:
42
  --marcflavor flavor       Set the MARC flavor. Valid values are marc21 (default),
43
                            normarc and unimarc.
44
  --zebralang lang          Choose the primary language for Zebra indexing. Valid
45
                            values are en (default), es, fr, nb, ru and uk.
46
  --auth-idx idx_mode       Set the indexing mode for authority records. Valid
47
                            values are dom (default) and grs1.
48
  --biblio-idx idx_mode     Set the indexing mode for bibliographic records.
49
                            Valid values are dom (default) and grs1.
50
  --use-memcached           Set the instance to make use of memcache.
51
  --memcached-servers str   Set a comma-separated list of host:port memcached servers.
52
  --memcached-prefix str    Set the desired prefix for the instance memcached namespace.
53
  --defaultsql some.sql     Specify a default SQL file to be loaded on the DB.
54
  --configfile cfg_file     Specify an alternate config file for reading default values.
55
  --passwdfile passwd       Specify an alternate passwd file.
56
  --database dbname         Enforce the use of the specified DB name (64 char limit)
57
  --adminuser n             Explicit the admin user ID in the DB. Relevant in
58
                            conjunction with --defaultsql and --populate-db.
59
  --help,-h                 Show this help.
60
61
Note: the instance name cannot be longer that 11 chars.
62
63
EOF
64
}
31
65
32
die() {
66
die() {
33
    echo "$@" 1>&2
67
    echo "$@" 1>&2
Lines 220-228 then Link Here
220
    . /etc/koha/koha-sites.conf
254
    . /etc/koha/koha-sites.conf
221
fi
255
fi
222
256
223
[ $# -ge 2 ] && [ $# -le 16 ] || die $usage
257
[ $# -ge 2 ] && [ $# -le 16 ] || ( usage ; die "Error: wrong parameters" )
224
258
225
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-prefix:, \
259
TEMP=`getopt -o chrpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,use-memcached,help,marcflavor:,auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,database:,adminuser:,memcached-servers:,memcached-prefix:, \
226
     -n "$0" -- "$@"`
260
     -n "$0" -- "$@"`
227
261
228
# Note the quotes around `$TEMP': they are essential!
262
# Note the quotes around `$TEMP': they are essential!
Lines 257-267 while true ; do Link Here
257
            CLO_MEMCACHED_PREFIX="$2" ; shift 2;;
291
            CLO_MEMCACHED_PREFIX="$2" ; shift 2;;
258
        -m|--marcflavor)
292
        -m|--marcflavor)
259
            CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;;
293
            CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;;
260
    -l|--zebralang)
294
        -l|--zebralang)
261
            CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;;
295
            CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;;
262
    --auth-idx)
296
        --auth-idx)
263
            CLO_AUTHORITIES_INDEXING_MODE="$2" ; shift 2 ;;
297
            CLO_AUTHORITIES_INDEXING_MODE="$2" ; shift 2 ;;
264
    --biblio-idx)
298
        --biblio-idx)
265
            CLO_BIBLIOS_INDEXING_MODE="$2" ; shift 2 ;;
299
            CLO_BIBLIOS_INDEXING_MODE="$2" ; shift 2 ;;
266
        -d|--defaultsql)
300
        -d|--defaultsql)
267
            CLO_DEFAULTSQL="$2" ; shift 2 ;;
301
            CLO_DEFAULTSQL="$2" ; shift 2 ;;
Lines 273-278 while true ; do Link Here
273
            CLO_DATABASE="$2" ; shift 2 ;;
307
            CLO_DATABASE="$2" ; shift 2 ;;
274
        -a|--adminuser)
308
        -a|--adminuser)
275
            CLO_ADMINUSER="$2" ; shift 2 ;;
309
            CLO_ADMINUSER="$2" ; shift 2 ;;
310
        -h|--help)
311
            usage ; exit 0 ;;
276
        --)
312
        --)
277
            shift ; break ;;
313
            shift ; break ;;
278
        *)
314
        *)
Lines 341-348 Please set USE_MEMCACHED="yes" on /etc/koha/koha-sites.conf or use the Link Here
341
377
342
EOF`
378
EOF`
343
379
344
    echo $usage
380
    usage ; die $MSG
345
    die $MSG
346
else
381
else
347
    # Unset memcached-related variables
382
    # Unset memcached-related variables
348
    MEMCACHED_SERVERS=""
383
    MEMCACHED_SERVERS=""
349
- 

Return to bug 11509