From ddea1703f1a43241d1d4219edf7e5c11bd22ad0d 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 b90e7d4e23..6d5ffa0e8d 100755 --- a/debian/scripts/koha-create +++ b/debian/scripts/koha-create @@ -65,6 +65,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. @@ -104,6 +105,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/__ELASTICSEARCH_SERVER__/${ELASTICSEARCH_SERVER}/g" \ @@ -379,7 +381,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:,elasticsearch-server:,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:,elasticsearch-server:,adminuser:,memcached-servers:,memcached-prefix:,template-cache-dir:,timezone:,upload-path:,tmp-path:,letsencrypt, \ -n "$0" -- "$@"` # Note the quotes around `$TEMP': they are essential! @@ -429,6 +431,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) @@ -583,6 +587,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 fe71b9ab48..247a60677b 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__ __DB_USE_TLS__ -- 2.20.1