View | Details | Raw Unified | Return to bug 6031
Collapse All | Expand All

(-)a/debian/scripts/koha-rebuild-zebra (-10 / +31 lines)
Lines 19-38 Link Here
19
19
20
set -e
20
set -e
21
21
22
opt_idx="-z"
23
opt_xml="-x"
24
opts_other=""
25
26
while [ -n "$*" ]; do
27
    case "$1" in
28
        -u|--usmarc)
29
             opt_xml=""
30
             ;;
31
        -f|--full)
32
             opt_idx="-r"
33
             ;;
34
        -*)
35
            opts_other="$opts_other $1";
36
            ;;
37
        *)
38
            break
39
            ;;
40
    esac
22
41
23
if [ "$1" = --full ]
24
then
25
    opts="-r"
26
    shift
42
    shift
27
else
43
done
28
    opts="-z"
29
fi
30
44
31
45
32
for name in "$@"
46
33
do
47
function run_zebra () {
48
    name=$1; shift
49
34
    sudo -u "$name-koha" -H \
50
    sudo -u "$name-koha" -H \
35
    env PERL5LIB=/usr/share/koha/lib \
51
    env PERL5LIB=/usr/share/koha/lib \
36
        KOHA_CONF="/etc/koha/sites/$name/koha-conf.xml" \
52
        KOHA_CONF="/etc/koha/sites/$name/koha-conf.xml" \
37
        /usr/share/koha/bin/migration_tools/rebuild_zebra.pl -b -a $opts
53
        /usr/share/koha/bin/migration_tools/rebuild_zebra.pl $@
54
}
55
56
for name in "$@"
57
do
58
    run_zebra $name -b $opt_idx $opt_xml $opts_other
59
    run_zebra $name -a $opt_idx $opts_other
38
done
60
done
39
- 

Return to bug 6031