Lines 118-124
generate_config_file() {
Link Here
|
118 |
} |
118 |
} |
119 |
|
119 |
|
120 |
getmysqlhost() { |
120 |
getmysqlhost() { |
121 |
if [ ! -f /etc/mysql/debian.cnf ] |
121 |
if [ ! -f /etc/mysql/koha-common.cnf ] |
122 |
then |
122 |
then |
123 |
echo localhost |
123 |
echo localhost |
124 |
return |
124 |
return |
Lines 143-148
getinstancemysqldatabase() {
Link Here
|
143 |
xmlstarlet sel -t -v 'yazgfs/config/database' "/etc/koha/sites/$1/koha-conf.xml" |
143 |
xmlstarlet sel -t -v 'yazgfs/config/database' "/etc/koha/sites/$1/koha-conf.xml" |
144 |
} |
144 |
} |
145 |
|
145 |
|
|
|
146 |
getinstancemysqlport() { |
147 |
xmlstarlet sel -t -v 'yazgfs/config/port' "/etc/koha/sites/$1/koha-conf.xml" |
148 |
} |
149 |
|
150 |
getinstancemysqlhost() { |
151 |
xmlstarlet sel -t -v 'yazgfs/config/hostname' "/etc/koha/sites/$1/koha-conf.xml" |
152 |
} |
153 |
|
146 |
check_apache_config() |
154 |
check_apache_config() |
147 |
{ |
155 |
{ |
148 |
|
156 |
|
Lines 686-698
then
Link Here
|
686 |
# something. |
694 |
# something. |
687 |
mysqluser=$(getinstancemysqluser $name) |
695 |
mysqluser=$(getinstancemysqluser $name) |
688 |
mysqldb=$(getinstancemysqldatabase $name) |
696 |
mysqldb=$(getinstancemysqldatabase $name) |
|
|
697 |
mysqlhost=$(getinstancemysqlhost $name) |
698 |
mysqlport=$(getinstancemysqlport $name) |
689 |
# Use the default database content if that exists. |
699 |
# Use the default database content if that exists. |
690 |
if [ -e "$DEFAULTSQL" ] |
700 |
if [ -e "$DEFAULTSQL" ] |
691 |
then |
701 |
then |
692 |
# Populate the database with default content. |
702 |
# Populate the database with default content. |
693 |
zcat -f "$DEFAULTSQL" | |
703 |
zcat -f "$DEFAULTSQL" | |
694 |
sed "s/__KOHASITE__/koha_$name/g" | |
704 |
sed "s/__KOHASITE__/koha_$name/g" | |
695 |
mysql --host="$mysqlhost" --user="$mysqluser" --password="$mysqlpwd" "$mysqldb" |
705 |
mysql --host="$mysqlhost" --port="$mysqlport" --user="$mysqluser" --password="$mysqlpwd" "$mysqldb" |
696 |
|
706 |
|
697 |
|
707 |
|
698 |
# Change the default user's password. |
708 |
# Change the default user's password. |
Lines 701-707
then
Link Here
|
701 |
perl -e ' |
711 |
perl -e ' |
702 |
use Digest::MD5 qw(md5_base64); |
712 |
use Digest::MD5 qw(md5_base64); |
703 |
while (<>) { print md5_base64($_), "\n"; }') |
713 |
while (<>) { print md5_base64($_), "\n"; }') |
704 |
mysql --host="$mysqlhost" --user="$mysqluser" \ |
714 |
mysql --host="$mysqlhost" --port="$mysqlport" --user="$mysqluser" \ |
705 |
--password="$mysqlpwd" <<eof |
715 |
--password="$mysqlpwd" <<eof |
706 |
USE \`$mysqldb\`; |
716 |
USE \`$mysqldb\`; |
707 |
UPDATE borrowers |
717 |
UPDATE borrowers |
708 |
- |
|
|