|
Lines 1-4
Link Here
|
| 1 |
#!/bin/sh |
1 |
#!/bin/bash |
| 2 |
# |
2 |
# |
| 3 |
# koha-start-zebra - Start Zebra for named Koha instances |
3 |
# koha-start-zebra - Start Zebra for named Koha instances |
| 4 |
# Copyright 2010 Catalyst IT, Ltd |
4 |
# Copyright 2010 Catalyst IT, Ltd |
|
Lines 56-61
start_zebra_instance()
Link Here
|
| 56 |
return 1 |
56 |
return 1 |
| 57 |
} |
57 |
} |
| 58 |
|
58 |
|
|
|
59 |
path_to_zebra_modules() |
| 60 |
{ |
| 61 |
# The list of paths to check |
| 62 |
local paths=( |
| 63 |
/usr/lib/x86_64-linux-gnu/idzebra-2.0/modules/ |
| 64 |
/usr/lib/idzebra-2.0/modules/ |
| 65 |
/usr/lib/i386-linux-gnu/idzebra-2.0/modules/ |
| 66 |
/usr/lib/aarch64-linux-gnu/idzebra-2.0/modules/ |
| 67 |
/usr/lib/arm-linux-gnueabi/idzebra-2.0/modules/ |
| 68 |
/usr/lib/arm-linux-gnueabihf/idzebra-2.0/modules/ |
| 69 |
/usr/lib/mips-linux-gnu/idzebra-2.0/modules/ |
| 70 |
/usr/lib/mipsel-linux-gnu/idzebra-2.0/modules/ |
| 71 |
/usr/lib/powerpc-linux-gnu/idzebra-2.0/modules/ |
| 72 |
/usr/lib/powerpc64le-linux-gnu/idzebra-2.0/modules/ |
| 73 |
/usr/lib/s390x-linux-gnu/idzebra-2.0/modules/ |
| 74 |
) |
| 75 |
for p in "${paths[@]}"; do |
| 76 |
if [ -e $p/mod-dom.so ] ; then |
| 77 |
echo $p |
| 78 |
return 0 |
| 79 |
fi |
| 80 |
done |
| 81 |
} |
| 82 |
|
| 83 |
set_up_module_link() |
| 84 |
{ |
| 85 |
# Find where the module is |
| 86 |
local modules=$(path_to_zebra_modules) |
| 87 |
if [ -z $modules ] ; then |
| 88 |
die "Unable to find zebra modules on your system." |
| 89 |
fi |
| 90 |
|
| 91 |
linkpath=/var/lib/koha/zebramodules |
| 92 |
# If the link exists, check the target of it. If it doesn't match what |
| 93 |
# we have, we'll replace it. |
| 94 |
if [ -L $linkpath ] ; then |
| 95 |
if [ $( /bin/readlink $linkpath ) = $modules ] ; then |
| 96 |
# Alles in Ordnung |
| 97 |
return 0 |
| 98 |
fi |
| 99 |
fi |
| 100 |
rm -f $linkpath |
| 101 |
ln -s $modules $linkpath |
| 102 |
} |
| 103 |
|
| 59 |
usage() |
104 |
usage() |
| 60 |
{ |
105 |
{ |
| 61 |
local scriptname=$0 |
106 |
local scriptname=$0 |
|
Lines 67-72
Usage: $scriptname instancename1 instancename2...
Link Here
|
| 67 |
EOF |
112 |
EOF |
| 68 |
} |
113 |
} |
| 69 |
|
114 |
|
|
|
115 |
set_up_module_link |
| 70 |
# Parse command line. |
116 |
# Parse command line. |
| 71 |
#[ $# -ge 1 ] || ( usage ; die "Missing instance name..." ) |
117 |
#[ $# -ge 1 ] || ( usage ; die "Missing instance name..." ) |
| 72 |
|
118 |
|
| 73 |
- |
|
|