Пример #1
0
$config['interfaces']['lan']['ipaddr'] = $lanip;
$config['interfaces']['lan']['subnet'] = $lanbits;
$config['interfaces']['lan']['gateway'] = $gwip;
unset($config['system']['dnsserver']);
$config['system']['dnsserver'][] = $dnsip;
$proto = 'http';
$webgui_restart = false;
// the next block is disabled,  until https will be available
/*
if ($config['system']['webgui']['protocol'] == 'https')
{
	fwrite($out, "\nDo you want to revert to HTTP as the webGUI protocol? (y/n) ");
	if (strcasecmp(chop(fgets($in)), 'y') == 0)
	{
		$config['system']['webgui']['protocol'] = 'http';
		$webgui_restart = true;
	}
	else
	{
		$proto = 'https';
	}
}
*/
write_config();
system_resolvconf_generate();
network_lan_configure();
if ($webgui_restart) {
    system_update_httpd_settings();
}
fwrite($out, "The LAN IP address has been set to {$lanip}/{$lanbits}.\n" . "You can now access the webGUI by opening the following URL\n" . "in your browser:\n" . "  {$proto}://{$lanip}/\n\n" . 'Press RETURN to continue.');
fgets($in);
Пример #2
0
            // update network interface settings
            services_dyndns_reset();
            $retval = system_resolvconf_generate();
            // if user changed the appliance ip address try to redirect it to the new one
            if ($retval == 0) {
                if ($config['interfaces']['lan']['dhcp'] == 'no') {
                    if ($config['interfaces']['lan']['ipaddr'] != $oldIpaddr) {
                        define('REDIRECT_REQ', "http://{$config['interfaces']['lan']['ipaddr']}{$_SERVER['REQUEST_URI']}");
                        define('REDIRECT_DLY', 1);
                        define('CONTENT_TOP', '<a href="' . REDIRECT_REQ . '">' . _('Click here to') . ' ' . _('access the web UI using the new IP address') . '</a>');
                        define('FILL_FORCE_FLUSH', true);
                        include 'include/blankpagetpl.php';
                    }
                }
            }
            $retval |= network_lan_configure();
            $retval |= services_dyndns_configure();
            // update applications that depends on network settings
            //
            config_unlock();
        }
        //
        $savemsg = get_std_save_message($retval);
    }
}
// stop here if redirected
if (defined('REDIRECT_REQ')) {
    exit;
}
// render the page content
require 'fbegin.inc';