From 69582b69da10d6a2e814a1bf3a9cc39c99206b53 Mon Sep 17 00:00:00 2001 From: Andreas Jonsson Date: Wed, 26 Jun 2019 11:08:47 +0200 Subject: [PATCH] Bug 23141: Add --dbport parameter to koha-create --- debian/scripts/koha-create | 11 ++++++++++- debian/templates/koha-conf-site.xml.in | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create index 5e60f7cd77..129a44c93e 100755 --- a/debian/scripts/koha-create +++ b/debian/scripts/koha-create @@ -62,6 +62,7 @@ Options: --configfile cfg_file Specify an alternate config file for reading default values. --passwdfile passwd Specify an alternate passwd file. --dbhost host Enforce the use of the specified DB server + --dbport port Override portnumber for DB server --database dbname Enforce the use of the specified DB name (64 char limit) --adminuser n Explicit the admin user ID in the DB. Relevant in conjunction with --defaultsql and --populate-db. @@ -101,6 +102,7 @@ generate_config_file() { -e "s/__API_SECRET__/$API_SECRET/g" \ -e "s/__DB_NAME__/$mysqldb/g" \ -e "s/__DB_HOST__/$mysqlhost/g" \ + -e "s/__DB_PORT__/$mysqlport/g" \ -e "s/__DB_USER__/$mysqluser/g" \ -e "s/__DB_PASS__/$mysqlpwd/g" \ -e "s/__UNIXUSER__/$username/g" \ @@ -373,7 +375,7 @@ fi [ $# -ge 1 ] && [ $# -le 16 ] || ( usage ; die "Error: wrong parameters" ) -TEMP=`getopt -o chrpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,enable-sru,sru-port:,help,marcflavor:,auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,dbhost:,database:,adminuser:,memcached-servers:,memcached-prefix:,template-cache-dir:,timezone:,upload-path:,tmp-path:,letsencrypt, \ +TEMP=`getopt -o chrpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,enable-sru,sru-port:,help,marcflavor:,auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,dbhost:,dbport:,database:,adminuser:,memcached-servers:,memcached-prefix:,template-cache-dir:,timezone:,upload-path:,tmp-path:,letsencrypt, \ -n "$0" -- "$@"` # Note the quotes around `$TEMP': they are essential! @@ -420,6 +422,8 @@ while true ; do CLO_DATABASE="$2" ; shift 2 ;; --dbhost) CLO_DBHOST="$2" ; shift 2 ;; + --dbport) + CLO_DBPORT="$2" ; shift 2 ;; -a|--adminuser) CLO_ADMINUSER="$2" ; shift 2 ;; --enable-sru) @@ -570,6 +574,11 @@ then mysqlhost="$CLO_DBHOST" fi +if [ "$CLO_DBPORT" != "" ] +then + mysqlport="$CLO_DBPORT" +fi + if [ "$mysqlhost" = "" ] then mysqlhost="$(getmysqlhost)" diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in index 2cd9688727..5dc2bbcf0e 100644 --- a/debian/templates/koha-conf-site.xml.in +++ b/debian/templates/koha-conf-site.xml.in @@ -266,7 +266,7 @@ __END_SRU_PUBLICSERVER__ mysql __DB_NAME__ __DB_HOST__ - 3306 + __DB_PORT__ __DB_USER__ __DB_PASS__ biblios -- 2.11.0