ia64/xen-unstable

changeset 7233:f98c8238e909

Gentoo compatible stuff has to be done *before* the set -e. You could also do
the which in the if with a combination of ! and || after the set -e but I think
it's cleaner to just do it before the set -e.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Oct 05 19:15:56 2005 +0100 (2005-10-05)
parents c3d9b7013b14
children 21606b84b730
files tools/examples/network-bridge
line diff
     1.1 --- a/tools/examples/network-bridge	Wed Oct 05 19:14:13 2005 +0100
     1.2 +++ b/tools/examples/network-bridge	Wed Oct 05 19:15:56 2005 +0100
     1.3 @@ -39,6 +39,17 @@
     1.4  #
     1.5  #============================================================================
     1.6  
     1.7 +# Gentoo doesn't have ifup/ifdown: define appropriate alternatives
     1.8 +which ifup >& /dev/null
     1.9 +if [ "$?" != 0 -a -e /etc/conf.d/net ]; then
    1.10 +    ifup() {
    1.11 +        /etc/init.d/net.$1 start
    1.12 +    }
    1.13 +    ifdown() {
    1.14 +        /etc/init.d/net.$1 stop
    1.15 +    }
    1.16 +fi
    1.17 +
    1.18  # Exit if anything goes wrong.
    1.19  set -e 
    1.20  
    1.21 @@ -55,17 +66,6 @@ antispoof=${antispoof:-no}
    1.22  
    1.23  echo "*network $OP bridge=$bridge netdev=$netdev antispoof=$antispoof" >&2
    1.24  
    1.25 -# Gentoo doesn't have ifup/ifdown: define appropriate alternatives
    1.26 -which ifup >& /dev/null
    1.27 -if [ "$?" != 0 -a -e /etc/conf.d/net ]; then
    1.28 -    ifup() {
    1.29 -        /etc/init.d/net.$1 start
    1.30 -    }
    1.31 -    ifdown() {
    1.32 -        /etc/init.d/net.$1 stop
    1.33 -    }
    1.34 -fi
    1.35 -
    1.36  # Usage: transfer_addrs src dst
    1.37  # Copy all IP addresses (including aliases) from device $src to device $dst.
    1.38  transfer_addrs () {