Changeset 1164
- Timestamp:
- 06/30/08 12:09:21 (6 months ago)
- Files:
-
- 5106R/trunk/ui/base-network.mod/Makefile (modified) (1 diff)
- 5106R/trunk/ui/base-network.mod/constructor/40_addGateway.pl (modified) (2 diffs)
- 5106R/trunk/ui/base-network.mod/templates/rpmdefs.tmpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
5106R/trunk/ui/base-network.mod/Makefile
r1146 r1164 8 8 9 9 VERSION=1.1.0 10 RELEASE=82BQ1 810 RELEASE=82BQ19 11 11 12 12 # add a buildarch if desired 5106R/trunk/ui/base-network.mod/constructor/40_addGateway.pl
r1146 r1164 34 34 open(CONF, $conf) || die "Can't read configfile: $conf\n"; 35 35 while (<CONF>) { 36 next unless /^GATEWAY=\s*(\S+)/; 37 if (! -f "/proc/user_beancounters") { 38 $gateway = $1; 39 } 40 else { 41 $gateway = "192.0.2.1"; 42 } 36 if (! -f "/proc/user_beancounters") { 37 next unless /^GATEWAY=\s*(\S+)/; 38 } 39 else { 40 next unless /^GATEWAY=\"(.*)\"/; 41 } 42 $gateway = $1; 43 43 } 44 44 } … … 47 47 if (!$gateway) { 48 48 $DEBUG && print STDERR "Gateway setting isn't found\n"; 49 my $data = `$Network::ROUTE -n|grep '^0\.0\.0\.0'`; 50 if ($data =~ /0\.0\.0\.0\s+((\d+).(\d+).(\d+).(\d+))/) { 51 $gateway = $1; 49 if ( ! -f "/proc/user_beancounters" ) { 50 my $data = `$Network::ROUTE -n|grep '^0\.0\.0\.0'`; 51 if ($data =~ /0\.0\.0\.0\s+((\d+).(\d+).(\d+).(\d+))/) { 52 $gateway = $1; 53 } 54 } 55 else { 56 # Set default OpenVZ gateway: 57 $gateway = "192.0.2.1"; 58 system("/bin/cat /etc/sysconfig/network |/bin/grep -v ^GATEWAY > /etc/sysconfig/network.bak"); 59 system("/bin/mv /etc/sysconfig/network.bak /etc/sysconfig/network"); 60 system("/bin/echo GATEWAY=\"192.0.2.1\" >> /etc/sysconfig/network"); 61 system("/etc/init.d/network restart > /dev/null"); 52 62 } 53 63 } 5106R/trunk/ui/base-network.mod/templates/rpmdefs.tmpl
r1146 r1164 103 103 <begin $CHANGELOG> 104 104 105 * Sat Jul 07 2008 Michael Stauber <mstauber@solarspeed.net> 1.1.0-82BQ18 105 * Sun Jun 29 2008 Michael Stauber <mstauber@solarspeed.net> 1.1.0-82BQ19 106 - Reworked OpenVZ provisions in constructor/40_addGateway.pl to set default OpenVZ gateway if it's missing. 107 108 * Sat Jun 07 2008 Michael Stauber <mstauber@solarspeed.net> 1.1.0-82BQ18 106 109 - Reworked OpenVZ provisions in constructor/30_addNetwork.pl constructor/40_addGateway.pl 107 110 108 * Fri Ju l06 2008 Michael Stauber <mstauber@solarspeed.net> 1.1.0-82BQ17111 * Fri Jun 06 2008 Michael Stauber <mstauber@solarspeed.net> 1.1.0-82BQ17 109 112 - Fixed handler rewrite-ifcfg.pl to not rewrite ifcfg-venet0 at all 110 113 111 * Tue Ju l02 2008 Michael Stauber <mstauber@solarspeed.net> 1.1.0-82BQ16114 * Tue Jun 02 2008 Michael Stauber <mstauber@solarspeed.net> 1.1.0-82BQ16 112 115 - Fully added OpenVZ provisions to all constructors, handlers, schemas and PHP pages. 113 116
