-Be more specific abount looking for -n argument on makedhcp

-Have nodeonmynet function more gracefully handle being passed an unresolvable name

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@863 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso
2008-03-20 21:36:49 +00:00
parent 8ffc30fdca
commit 91577c2132
2 changed files with 4 additions and 1 deletions

View File

@@ -1211,6 +1211,9 @@ sub nodeonmynet
{
$nodetocheck = shift;
}
unless (inet_aton($nodetocheck)) {
return 0;
}
my $nodeip = inet_ntoa(inet_aton($nodetocheck));
unless ($nodeip =~ /\d+\.\d+\.\d+\.\d+/)
{

View File

@@ -227,7 +227,7 @@ sub process_request {
$callback->({data=>["Usage: makedhcp <-n> <noderange>"]});
return;
}
if (grep /-n/,@{$req->{arg}}) {
if (grep /^-n$/,@{$req->{arg}}) {
if (-e "/etc/dhcpd.conf") {
my $bakname = "/etc/dhcpd.conf.xcatbak";
rename("/etc/dhcpd.conf",$bakname);