Esempio n. 1
0
/**
 * Set Ethernet static IP address
 */
function setEthIP($ip)
{
    $ip = '169.254.1.' . $ip;
    $networkConfiguration = networkConfiguration();
    setNetworkConfiguration($ip, $networkConfiguration['wifi']);
    $response = shell_exec("sudo service networking reload");
}
Esempio n. 2
0
/**
 * Set Wlan 
 */
function setWifi($ssid, $password, $type = "WPA")
{
    $networkConfiguration = networkConfiguration();
    setNetworkConfiguration($networkConfiguration['eth'], array('ssid' => $ssid, 'password' => $password, 'type' => $type));
    $response = shell_exec("sudo service networking reload");
    if (strpos($response, 'PING') !== false || strpos($response, 'errors') !== false) {
        return false;
    } else {
        return true;
    }
}