Making plugin - Function to check if hostname exists



  • Hi there… I’m making a plugin for FOG… I know there is a function called hostsExists to check if a mac address exists in the hosts table… however, is there any function to check if the hostname exists?

    Regards,
    Alipio Luiz


  • Developer

    Code for 0.33 BETA
    [code]// Within a FOG Class
    $hostExists = $this->getClass(‘HostManager’)->exists(array(‘name’ => ‘chicken’)));

    // Outside of a FOG Class
    $hostExists = $GLOBALS[‘FOGCore’]->getClass(‘HostManager’)->exists(array(‘name’ => ‘chicken’)));[/code]


Log in to reply
 

428
Online

38946
Users

10698
Topics

101511
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.