defect 2947777: add the subroutine getTftpDir

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5278 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
daniceexi 2010-02-24 08:49:37 +00:00
parent a4e2edcda4
commit 272227fbf2

View File

@ -1245,6 +1245,46 @@ sub getInstallDir
#--------------------------------------------------------------------------------
=head3 getTftpDir
Get location of the directory, used to hold network boot files.
Arguments:
none
Returns:
path to TFTP directory defined at site.tftpdir.
Globals:
none
Error:
none
Example:
$tftpdir = xCAT::Utils->getTftpDir();
Comments:
none
=cut
#--------------------------------------------------------------------------------
sub getTftpDir
{
# Default tftpdir location. Used by default in most Linux distros.
my $tftpdir = "/tftpboot";
# Try to lookup real tftpdir place.
my @tftpdir1 = get_site_attribute("tftpdir");
# Use fetched value, incase successful database lookup.
if ($tftpdir1[0])
{
$tftpdir = $tftpdir1[0];
}
return $tftpdir;
}
#--------------------------------------------------------------------------------
=head3 getHomeDir
Get the path the user home directory from /etc/passwd.