~ubuntu-branches/ubuntu/karmic/vzctl/karmic

« back to all changes in this revision

Viewing changes to etc/dists/scripts/suse-8.x_add_ip.sh

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2007-04-10 18:08:16 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070410180816-0uuzj9fnna7gmzxv
Tags: 3.0.16-4
Etch has been released which means that this version can be uploaded
to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/bash
2
 
#  Copyright (C) 2000-2006 SWsoft. All rights reserved.
 
2
#  Copyright (C) 2000-2007 SWsoft. All rights reserved.
3
3
#
4
4
#  This program is free software; you can redistribute it and/or modify
5
5
#  it under the terms of the GNU General Public License as published by
29
29
VENET_DEV=venet0
30
30
VENET_DEV_CFG=ifcfg-$VENET_DEV
31
31
 
32
 
FAKEGATEWAY=191.255.255.1
33
 
FAKEGATEWAYNET=191.255.255.0
34
32
 
35
33
IFCFG_DIR=/etc/sysconfig/network/
36
34
IFCFG=${IFCFG_DIR}/ifcfg-${VENET_DEV}
121
119
{
122
120
        local ip
123
121
        local new_ips 
 
122
        local if_restart=
124
123
 
125
124
        # In case we are starting VE
126
125
        if [ "x${VE_STATE}" = "xstarting" ]; then
127
126
                # Remove all VENET config files
128
 
                rm -f ${IFCFG_DIR}/${VENET_DEV_CFG}:* >/dev/null 2>&1
 
127
                rm -f ${IFCFG} ${IFCFG}:* >/dev/null 2>&1
 
128
        fi
 
129
        if [ ! -f "${IFCFG}" ]; then
129
130
                setup_network
 
131
                if_restart=1
130
132
        fi
131
133
        backup_configs ${IPDELALL}
132
134
        new_ips="${IP_ADDR}"
148
150
        done
149
151
        move_configs
150
152
        if [ "x${VE_STATE}" = "xrunning" ]; then
151
 
                if [ -n "${IPDELALL}" ]; then
152
 
                        ifdown ${VENET_DEV} >/dev/null 2>&1
153
 
                fi 
154
 
                ifup ${VENET_DEV} -o doalias >/dev/null 2>&1
 
153
                ifdown ${VENET_DEV} >/dev/null 2>&1
 
154
                ifup ${VENET_DEV} >/dev/null 2>&1
155
155
        fi
156
156
}
157
157