Sets the default borrowernumber of staff user to 1 and makes it possible
to override this with ADMINUSER in /etc/koha/koha-sites.conf or with the
--adminuser and -a command line options.
Remember to update the wiki if this gets pushed!
Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
[--marcflavor marc21|normarc|unimarc] \
[--zebralang en|nb|fr] \
[--defaultsql /path/to/some.sql] \
[--marcflavor marc21|normarc|unimarc] \
[--zebralang en|nb|fr] \
[--defaultsql /path/to/some.sql] \
- [--configfile /path/to/config] instancename"
+ [--configfile /path/to/config] [--adminuser n] instancename"
DEFAULTSQL=""
ZEBRA_MARC_FORMAT="marc21"
ZEBRA_LANGUAGE="en"
DEFAULTSQL=""
ZEBRA_MARC_FORMAT="marc21"
ZEBRA_LANGUAGE="en"
if [ -e /etc/koha/koha-sites.conf ]
then
. /etc/koha/koha-sites.conf
fi
if [ -e /etc/koha/koha-sites.conf ]
then
. /etc/koha/koha-sites.conf
fi
-[ $# -ge 2 ] && [ $# -le 10 ] || die $usage
+[ $# -ge 2 ] && [ $# -le 12 ] || die $usage
-TEMP=`getopt -o crpm:l:d:f: -l create-db,request-db,populate-db,marcflavor:,zebralang:,defaultsql:,configfile: \
+TEMP=`getopt -o crpm:l:d:f:a: -l create-db,request-db,populate-db,marcflavor:,zebralang:,defaultsql:,configfile:,adminuser: \
-n "$0" -- "$@"`
# Note the quotes around `$TEMP': they are essential!
-n "$0" -- "$@"`
# Note the quotes around `$TEMP': they are essential!
CLO_ZEBRA_MARC_FORMAT=""
CLO_ZEBRA_LANGUAGE=""
CLO_DEFAULTSQL=""
CLO_ZEBRA_MARC_FORMAT=""
CLO_ZEBRA_LANGUAGE=""
CLO_DEFAULTSQL=""
while true ; do
case "$1" in
while true ; do
case "$1" in
-l|--zebralang) CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;;
-d|--defaultsql) CLO_DEFAULTSQL="$2" ; shift 2 ;;
-f|--configfile) configfile="$2" ; shift 2 ;;
-l|--zebralang) CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;;
-d|--defaultsql) CLO_DEFAULTSQL="$2" ; shift 2 ;;
-f|--configfile) configfile="$2" ; shift 2 ;;
+ -a|--adminuser) CLO_ADMINUSER="$2" ; shift 2 ;;
--) shift ; break ;;
*) die "Internal error processing command line arguments" ;;
esac
--) shift ; break ;;
*) die "Internal error processing command line arguments" ;;
esac
then
DEFAULTSQL="$CLO_DEFAULTSQL"
fi
then
DEFAULTSQL="$CLO_DEFAULTSQL"
fi
+if [ "$CLO_ADMINUSER" != "" ]
+then
+ ADMINUSER="$CLO_ADMINUSER"
+fi
USE \`$mysqldb\`;
UPDATE borrowers
SET password = '$staffdigest'
USE \`$mysqldb\`;
UPDATE borrowers
SET password = '$staffdigest'
-WHERE borrowernumber = 3;
+WHERE borrowernumber = $ADMINUSER;
eof
#`
echo "staff user password is '$staffpass' but keep that secret"
eof
#`
echo "staff user password is '$staffpass' but keep that secret"