Example #1
0
function write_ifcfg($filename, $interface, $uuid)
{
    //Write to file with a standard template
    $ipaddr = get_ipaddr();
    if ($ipaddr != '') {
        $ipsettings = 'BOOTPROTO=static
IPADDR=' . $ipaddr . '
NETMASK=' . get_subnet() . '
GATEWAY=' . get_ipgateway();
    } else {
        $ipsettings = 'BOOTPROTO=dhcp';
    }
    file_put_contents($filename, "TYPE=Ethernet\n{$ipsettings}\nDEFROUTE=yes\nPEERDNS=yes\nPEERROUTES=yes\nIPV4_FAILURE_FATAL=no\nIPV6INIT=yes\nIPV6_AUTOCONF=yes\nIPV6_DEFROUTE=yes\nIPV6_PEERDNS=yes\nIPV6_PEERROUTES=yes\nIPV6_FAILURE_FATAL=no\nNAME={$interface}\nUUID={$uuid}\nDEVICE={$interface}\nONBOOT=yes\n");
}
Example #2
0
        <div class="panel">
          	<h3>Thank you for choosing Smart-Message! </h3>
          	<form name="mmg_numbers" method="post" action="#">
          		<p>To access this appliance from your network, please configure the network options below. Remember to connect your network to the correct physical port on this appliance.</p>
          
			<div class="row">
            		
				<div class="large-6 medium-6 columns">
              				<label>Network IPv4 Address (Leave blank for DHCP)</label>
              				<input type="text" name="staticIP" placeholder="Leave blank for dynamic IP Address" value="<?php 
echo get_ipaddr();
?>
"/>
              				<label>Network IPv4 Subnet </label>
              				<input type="text" name="staticSN" placeholder="Leave blank for DHCP assigned value" value="<?php 
echo get_subnet();
?>
"/>
              				<label>Network IPv4 Gateway</label>
              				<input type="text" name="staticGW" placeholder="Leave blank for DHCP assigned value" value="<?php 
echo get_ipgateway();
?>
"/>
              				<label>Network IPv4 DNS</label>
              				<input type="text" name="staticDNS" placeholder="Leave blank for DHCP assigned value" value="<?php 
echo get_ipdns();
?>
"/>
            			</div>
            
				<div class="large-6 medium-6 columns">