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

(-)a/debian/docs/koha-foreach.xml (+1 lines)
Lines 29-34 Link Here
29
29
30
  <refsect1><title>Description</title>
30
  <refsect1><title>Description</title>
31
  <para>Run a command for each Koha instance. Takes the same arguments as koha-list.</para>
31
  <para>Run a command for each Koha instance. Takes the same arguments as koha-list.</para>
32
  <para>The string "__instancename__" is replaced in the argument list with the name of the Koha instance in each iteration.</para>
32
  </refsect1>
33
  </refsect1>
33
  
34
  
34
  <refsect1><title>See also</title>
35
  <refsect1><title>See also</title>
(-)a/debian/scripts/koha-foreach (-2 / +2 lines)
Lines 32-43 done Link Here
32
            
32
            
33
for name in $(koha-list $listopts)
33
for name in $(koha-list $listopts)
34
do
34
do
35
    cmd=`echo "$@" | sed -e s/__instancename__/${name}/g`
35
    (
36
    (
36
    exec 3>&1
37
    exec 3>&1
37
    sudo -u "$name-koha" \
38
    sudo -u "$name-koha" \
38
    env PERL5LIB=/usr/share/koha/lib \
39
    env PERL5LIB=/usr/share/koha/lib \
39
        KOHA_CONF="/etc/koha/sites/$name/koha-conf.xml" \
40
        KOHA_CONF="/etc/koha/sites/$name/koha-conf.xml" \
40
        "$@" 2>&1 >&3 | sed -e "s/^/$name: /" >&2 3>&-
41
        ${cmd} 2>&1 >&3 | sed -e "s/^/$name: /" >&2 3>&-
41
    exec 3>&-
42
    exec 3>&-
42
    ) | sed -e "s/^/$name: /"
43
    ) | sed -e "s/^/$name: /"
43
44
44
- 

Return to bug 8566