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

« back to all changes in this revision

Viewing changes to etc/dists/scripts/redhat-7.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
30
30
VENET_DEV=venet0
31
31
VENET_DEV_CFG=ifcfg-$VENET_DEV
32
32
 
33
 
FAKEGATEWAY=191.255.255.1
34
 
FAKEGATEWAYNET=191.255.255.0
35
33
 
36
34
IFCFG_DIR=/etc/sysconfig/network-scripts
37
35
IFCFG=${IFCFG_DIR}/ifcfg-${VENET_DEV}
147
145
{
148
146
        local ip
149
147
        local new_ips 
 
148
        local if_restart=
150
149
 
151
150
        # In case we are starting VE
152
151
        if [ "x${VE_STATE}" = "xstarting" ]; then
153
152
                # Remove all VENET config files
154
 
                rm -f ${IFCFG_DIR}/${VENET_DEV_CFG}:* >/dev/null 2>&1
 
153
                rm -f ${IFCFG} ${IFCFG}:* >/dev/null 2>&1
 
154
        fi
 
155
        if [ ! -f "${IFCFG}" ]; then
155
156
                setup_network
 
157
                if_restart=1
156
158
        fi
157
159
        backup_configs ${IPDELALL}
158
160
        new_ips="${IP_ADDR}"
174
176
        done
175
177
        move_configs
176
178
        if [ "x${VE_STATE}" = "xrunning" ]; then
177
 
                # synchronyze config files & interfaces
178
 
                cd /etc/sysconfig/network-scripts && ./ifup-aliases ${VENET_DEV}
 
179
                if [ -n "${if_restart}" ]; then
 
180
                        ifup ${VENET_DEV}
 
181
                else
 
182
                        # synchronyze config files & interfaces
 
183
                        cd /etc/sysconfig/network-scripts && ./ifup-aliases ${VENET_DEV}
 
184
                fi
179
185
        fi
180
186
}
181
187