Enables or disables the WLAN guest access of a Fritz!Box Usage on UNIX systems: /path/to/php ' . $argv[0] . ' {0|1} [optional: PASSWORD] Usage on Windows systems: c:\\path\\to\\php.exe ' . $argv[0] . ' {0|1} [optional: PASSWORD] 0 disables the guest access 1 enables the guest access The optional argument PASSWORD sets a new guest access password (min 8 chars) Defaults to false, so the current password is kept. '; } else { $fritz->logMessage($message . 'ERROR: Script was called without or with an invalid argument'); } exit; } $wpa_key = isset($argv[2]) && strlen($argv[2]) >= 8 && strlen($argv[2]) <= 63 ? $argv[2] : false; // read the current settings $formfields = array('getpage' => '/wlan/guest_access.lua'); $output = $fritz->doGetRequest($formfields); // read down_time_activ setting preg_match('@name="down_time_activ"[^>]+(checked)[^>]*@', $output, $matches); if (isset($matches[1])) { $formfields['down_time_activ'] = 'on'; } // read down_time_value setting preg_match('@name="down_time_value".*?<option value="(\\d+)"[^>]+?selected.*?</select>@s', $output, $matches); $formfields['down_time_value'] = isset($matches[1]) ? $matches[1] : '15';