Lines 17-22
Link Here
|
17 |
# You should have received a copy of the GNU General Public License |
17 |
# You should have received a copy of the GNU General Public License |
18 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 |
|
19 |
|
|
|
20 |
set -e |
20 |
umask 0077 |
21 |
umask 0077 |
21 |
|
22 |
|
22 |
# include helper functions |
23 |
# include helper functions |
Lines 48-67
is_instance "$name" || ( usage; die "Unknown instance '$name'" )
Link Here
|
48 |
shift # remove instance name from argument list. |
49 |
shift # remove instance name from argument list. |
49 |
kohaconfig="/etc/koha/sites/$name/koha-conf.xml" |
50 |
kohaconfig="/etc/koha/sites/$name/koha-conf.xml" |
50 |
|
51 |
|
51 |
mysqlhost="$( xmlstarlet sel -t -v 'yazgfs/config/hostname' $kohaconfig )" || die "hostname missing from $kohaconfig" |
52 |
mysqlhost="$( xmlstarlet sel -t -v 'yazgfs/config/hostname' $kohaconfig )" |
52 |
mysqldb="$( xmlstarlet sel -t -v 'yazgfs/config/database' $kohaconfig )" || die "database missing from $kohaconfig" |
53 |
mysqldb="$( xmlstarlet sel -t -v 'yazgfs/config/database' $kohaconfig )" |
53 |
mysqluser="$( xmlstarlet sel -t -v 'yazgfs/config/user' $kohaconfig )" || die "user missing from $kohaconfig" |
54 |
mysqluser="$( xmlstarlet sel -t -v 'yazgfs/config/user' $kohaconfig )" |
54 |
mysqlpass="$( xmlstarlet sel -t -v 'yazgfs/config/pass' $kohaconfig )" || die "pass missing from $kohaconfig" |
55 |
mysqlpass="$( xmlstarlet sel -t -v 'yazgfs/config/pass' $kohaconfig )" |
55 |
|
56 |
|
56 |
mysqltz="$( xmlstarlet sel -t -v 'yazgfs/config/timezone' $kohaconfig )" |
57 |
mysqltz="$( xmlstarlet sel -t -v 'yazgfs/config/timezone' $kohaconfig || true )" |
57 |
if [ $? -eq 0 ] |
58 |
if [ "$mysqltz" != "" ] |
58 |
then |
59 |
then |
59 |
echo "Using time zone $mysqltz" |
60 |
mysql --host="$mysqlhost" --user="$mysqluser" --password="$mysqlpass" --init-command="SET time_zone='$mysqltz'" \ |
60 |
mysql --host="$mysqlhost" --user="$mysqluser" --password="$mysqlpass" --init-command="SET time_zone = '$mysqltz'" \ |
61 |
"$mysqldb" "${@}" |
61 |
"$mysqldb" "${@}" |
|
|
62 |
else |
62 |
else |
63 |
echo "No time zone set for Koha, using database time zone." |
63 |
mysql --host="$mysqlhost" --user="$mysqluser" --password="$mysqlpass" \ |
64 |
mysql --host="$mysqlhost" --user="$mysqluser" --password="$mysqlpass" \ |
64 |
"$mysqldb" "${@}" |
65 |
"$mysqldb" "${@}" |
|
|
66 |
fi |
65 |
fi |
67 |
|
|
|
68 |
- |