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

(-)a/debian/scripts/koha-create (-5 / +11 lines)
Lines 23-29 usage="Usage: $0 [--create-db|--request-db|--populate-db] \ Link Here
23
    [--marcflavor marc21|normarc|unimarc] \
23
    [--marcflavor marc21|normarc|unimarc] \
24
    [--zebralang en|nb|fr] \
24
    [--zebralang en|nb|fr] \
25
    [--defaultsql /path/to/some.sql] \
25
    [--defaultsql /path/to/some.sql] \
26
    [--configfile /path/to/config] instancename"
26
    [--configfile /path/to/config] [--adminuser n] instancename"
27
27
28
die() {
28
die() {
29
    echo "$@" 1>&2
29
    echo "$@" 1>&2
Lines 72-85 INTRASUFFIX="" Link Here
72
DEFAULTSQL=""
72
DEFAULTSQL=""
73
ZEBRA_MARC_FORMAT="marc21"
73
ZEBRA_MARC_FORMAT="marc21"
74
ZEBRA_LANGUAGE="en"
74
ZEBRA_LANGUAGE="en"
75
ADMINUSER="1"
75
if [ -e /etc/koha/koha-sites.conf ]
76
if [ -e /etc/koha/koha-sites.conf ]
76
then
77
then
77
    . /etc/koha/koha-sites.conf
78
    . /etc/koha/koha-sites.conf
78
fi
79
fi
79
80
80
[ $# -ge 2 ] && [ $# -le 10 ] || die $usage
81
[ $# -ge 2 ] && [ $# -le 12 ] || die $usage
81
82
82
TEMP=`getopt -o crpm:l:d:f: -l create-db,request-db,populate-db,marcflavor:,zebralang:,defaultsql:,configfile: \
83
TEMP=`getopt -o crpm:l:d:f:a: -l create-db,request-db,populate-db,marcflavor:,zebralang:,defaultsql:,configfile:,adminuser: \
83
     -n "$0" -- "$@"`
84
     -n "$0" -- "$@"`
84
85
85
# Note the quotes around `$TEMP': they are essential!
86
# Note the quotes around `$TEMP': they are essential!
Lines 89-94 eval set -- "$TEMP" Link Here
89
CLO_ZEBRA_MARC_FORMAT=""
90
CLO_ZEBRA_MARC_FORMAT=""
90
CLO_ZEBRA_LANGUAGE=""
91
CLO_ZEBRA_LANGUAGE=""
91
CLO_DEFAULTSQL=""
92
CLO_DEFAULTSQL=""
93
CLO_ADMINUSER=""
92
94
93
while true ; do
95
while true ; do
94
	case "$1" in
96
	case "$1" in
Lines 99-104 while true ; do Link Here
99
		-l|--zebralang) CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;;
101
		-l|--zebralang) CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;;
100
		-d|--defaultsql) CLO_DEFAULTSQL="$2" ; shift 2 ;;
102
		-d|--defaultsql) CLO_DEFAULTSQL="$2" ; shift 2 ;;
101
		-f|--configfile) configfile="$2" ; shift 2 ;;
103
		-f|--configfile) configfile="$2" ; shift 2 ;;
104
		-a|--adminuser) CLO_ADMINUSER="$2" ; shift 2 ;;
102
		--) shift ; break ;;
105
		--) shift ; break ;;
103
		*) die "Internal error processing command line arguments" ;;
106
		*) die "Internal error processing command line arguments" ;;
104
	esac
107
	esac
Lines 125-130 if [ "$CLO_DEFAULTSQL" != "" ] Link Here
125
then
128
then
126
    DEFAULTSQL="$CLO_DEFAULTSQL"
129
    DEFAULTSQL="$CLO_DEFAULTSQL"
127
fi
130
fi
131
if [ "$CLO_ADMINUSER" != "" ]
132
then
133
    ADMINUSER="$CLO_ADMINUSER"
134
fi
128
135
129
name="$1"
136
name="$1"
130
137
Lines 249-255 then Link Here
249
USE \`$mysqldb\`;
256
USE \`$mysqldb\`;
250
UPDATE borrowers 
257
UPDATE borrowers 
251
SET password = '$staffdigest' 
258
SET password = '$staffdigest' 
252
WHERE borrowernumber = 3;
259
WHERE borrowernumber = $ADMINUSER;
253
eof
260
eof
254
261
255
        echo "staff user password is '$staffpass' but keep that secret"
262
        echo "staff user password is '$staffpass' but keep that secret"
256
- 

Return to bug 6516