1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00
raspap-webgui/ajax/networking/get_channel.php

18 lines
440 B
PHP
Raw Normal View History

2019-12-27 07:34:09 +01:00
<?php
2020-02-15 18:57:46 +01:00
require '../../includes/csrf.php';
require_once '../../includes/config.php';
2019-12-27 07:34:09 +01:00
exec('cat '. RASPI_HOSTAPD_CONFIG, $hostapdconfig);
$arrConfig = array();
foreach ($hostapdconfig as $hostapdconfigline) {
if (strlen($hostapdconfigline) === 0) {
continue;
}
2020-02-15 18:57:46 +01:00
$arrLine = explode("=", $hostapdconfigline);
2019-12-27 07:34:09 +01:00
$arrConfig[$arrLine[0]]=$arrLine[1];
};
$channel = intval($arrConfig['channel']);
echo json_encode($channel);