|
Lines 17-24
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 |
|
|
| 21 |
|
| 22 |
umask 0077 |
20 |
umask 0077 |
| 23 |
|
21 |
|
| 24 |
# include helper functions |
22 |
# include helper functions |
|
Lines 50-60
is_instance "$name" || ( usage; die "Unknown instance '$name'" )
Link Here
|
| 50 |
shift # remove instance name from argument list. |
48 |
shift # remove instance name from argument list. |
| 51 |
kohaconfig="/etc/koha/sites/$name/koha-conf.xml" |
49 |
kohaconfig="/etc/koha/sites/$name/koha-conf.xml" |
| 52 |
|
50 |
|
| 53 |
mysqlhost="$( xmlstarlet sel -t -v 'yazgfs/config/hostname' $kohaconfig )" |
51 |
mysqlhost="$( xmlstarlet sel -t -v 'yazgfs/config/hostname' $kohaconfig )" || die "hostname missing from $kohaconfig" |
| 54 |
mysqldb="$( xmlstarlet sel -t -v 'yazgfs/config/database' $kohaconfig )" |
52 |
mysqldb="$( xmlstarlet sel -t -v 'yazgfs/config/database' $kohaconfig )" || die "database missing from $kohaconfig" |
| 55 |
mysqluser="$( xmlstarlet sel -t -v 'yazgfs/config/user' $kohaconfig )" |
53 |
mysqluser="$( xmlstarlet sel -t -v 'yazgfs/config/user' $kohaconfig )" || die "user missing from $kohaconfig" |
| 56 |
mysqlpass="$( xmlstarlet sel -t -v 'yazgfs/config/pass' $kohaconfig )" |
54 |
mysqlpass="$( xmlstarlet sel -t -v 'yazgfs/config/pass' $kohaconfig )" || die "pass missing from $kohaconfig" |
| 57 |
|
55 |
|
| 58 |
mysql --host="$mysqlhost" --user="$mysqluser" --password="$mysqlpass" \ |
56 |
mysqltz="$( xmlstarlet sel -t -v 'yazgfs/config/timezone' $kohaconfig )" |
|
|
57 |
if [ $? -eq 0 ] |
| 58 |
then |
| 59 |
echo "Using time zone $mysqltz" |
| 60 |
mysql --host="$mysqlhost" --user="$mysqluser" --password="$mysqlpass" --init-command="SET time_zone = '$mysqltz'" \ |
| 61 |
"$mysqldb" "${@}" |
| 62 |
else |
| 63 |
echo "No time zone set for Koha, using database time zone." |
| 64 |
mysql --host="$mysqlhost" --user="$mysqluser" --password="$mysqlpass" \ |
| 59 |
"$mysqldb" "${@}" |
65 |
"$mysqldb" "${@}" |
|
|
66 |
fi |
| 60 |
|
67 |
|
| 61 |
- |
|
|