ACC SHELL

Path : /usr/share/YaST2/clients/
File Upload :
Current File : //usr/share/YaST2/clients/inst_hostname.ycp

/**
 * File:	clients/inst_hostname.ycp
 * Package:	Network configuration
 * Summary:	Mandatory hostname configuration
 * Authors:	Martin Vidner <mvidner@suse.cz>
 *
 * $Id: inst_hostname.ycp 60556 2010-01-27 14:21:30Z kmachalkova $
 */

{

textdomain "network";

import "Arch";
import "DNS";
import "GetInstArgs";
import "NetworkConfig";
import "String";
import "Wizard";
import "ProductControl";
import "ProductFeatures";

include "network/services/dns.ycp";


/* Called backwards */
//if(GetInstArgs::going_back())
//   return `auto;

// only once, do not re-propose if user gets back to this dialog from
// the previous screen - bnc#438124
if (!DNS::proposal_valid) {
    DNS::Read ();			// handles NetworkConfig too
    DNS::ProposeHostname();		// generate random hostname, if none known so far

    // propose settings
    DNS::dhcp_hostname = ! Arch::is_laptop ();

    // get default value, from control.xml
    DNS::write_hostname = DNS::DefaultWriteHostname();
}

symbol ret = `next;

//No need for interactive UI in automatic configuration
if ( ! GetInstArgs::automatic_configuration() )
{
    Wizard::SetDesktopIcon("dns");
    ret = HostnameDialog ();
}
//but we need to force writing /etc/HOSTNAME in such case
//(#383336)
else
{
    DNS::modified = true;
}

if (ret == `next)
{
    // do not let Lan override us, #152218
    DNS::proposal_valid = true;

    // delay writing, write along with the rest of network configuration
    // in lan_proposal
    // DNS::Write ();
}

return ret;

/* EOF */
}

ACC SHELL 2018