-Switch to using symbolic rather than hard links as possible

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2112 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-09-09 22:28:30 +00:00
parent 2f4f7acab5
commit 66bddcad5d
2 changed files with 12 additions and 2 deletions

View File

@ -126,11 +126,16 @@ sub setstate {
}
}
}
my $hassymlink = eval { symlink("",""); 1 };
foreach $ip (keys %ipaddrs) {
my @ipa=split(/\./,$ip);
my $pname = sprintf("%02X%02X%02X%02X",@ipa);
unlink($tftpdir."/pxelinux.cfg/".$pname);
link($tftpdir."/pxelinux.cfg/".$node,$tftpdir."/pxelinux.cfg/".$pname);
if ($hassymlink) {
symlink($node,$tftpdir."/pxelinux.cfg/".$pname);
} else {
link($tftpdir."/pxelinux.cfg/".$node,$tftpdir."/pxelinux.cfg/".$pname);
}
}
}

View File

@ -135,11 +135,16 @@ sub setstate {
}
}
}
my $hassymlink = eval { symlink("",""); 1 };
foreach $ip (keys %ipaddrs) {
my @ipa=split(/\./,$ip);
my $pname = sprintf("%02x%02x%02x%02x",@ipa);
unlink($tftpdir."/etc/".$pname);
link($tftpdir."/etc/".$node,$tftpdir."/etc/".$pname);
if ($hassymlink) {
symlink($node,$tftpdir."/etc/".$pname);
} else {
link($tftpdir."/etc/".$node,$tftpdir."/etc/".$pname);
}
}
}