mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Set country_code from iw reg if undefined
This commit is contained in:
parent
695cdd2d35
commit
3d901ae5f9
@ -27,6 +27,7 @@ function DisplayHostAPDConfig()
|
|||||||
$arrEncType = array('TKIP' => 'TKIP', 'CCMP' => 'CCMP', 'TKIP CCMP' => 'TKIP+CCMP');
|
$arrEncType = array('TKIP' => 'TKIP', 'CCMP' => 'CCMP', 'TKIP CCMP' => 'TKIP+CCMP');
|
||||||
$managedModeEnabled = false;
|
$managedModeEnabled = false;
|
||||||
exec("ip -o link show | awk -F': ' '{print $2}'", $interfaces);
|
exec("ip -o link show | awk -F': ' '{print $2}'", $interfaces);
|
||||||
|
exec("iw reg get | awk '/country / { sub(/:/,\"\",$2); print $2 }'", $country_code);
|
||||||
|
|
||||||
if (!RASPI_MONITOR_ENABLED) {
|
if (!RASPI_MONITOR_ENABLED) {
|
||||||
if (isset($_POST['SaveHostAPDSettings'])) {
|
if (isset($_POST['SaveHostAPDSettings'])) {
|
||||||
@ -77,6 +78,11 @@ function DisplayHostAPDConfig()
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// assign country_code from iw reg if not set in config
|
||||||
|
if (!isset($arrConfig['country_code']) && isset($country_code[0])) {
|
||||||
|
$arrConfig['country_code'] = $country_code[0];
|
||||||
|
}
|
||||||
|
|
||||||
echo renderTemplate(
|
echo renderTemplate(
|
||||||
"hostapd", compact(
|
"hostapd", compact(
|
||||||
"status",
|
"status",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user