mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-03 21:02:34 +00:00 
			
		
		
		
	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:
		@@ -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.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user