182,14 → 182,16 |
} |
} |
break; |
case 'del_mac' : |
case 'del_host' : |
foreach ($_POST as $key => $value) |
{ |
if ($value == 'on') |
{ |
$ether_file=ETHERS_FILE; |
exec("/bin/sed -i \"/^$key/d\" $ether_file"); |
exec ("sudo /usr/bin/systemctl reload chilli"); |
$dns_local_file=DNS_LOCAL_FILE; |
exec("/bin/sed -i \"/$key/d\" $dns_local_file"); |
exec ("sudo /usr/bin/systemctl restart dnsmasq"); |
exec ("sudo /usr/bin/systemctl restart dnsmasq-blacklist"); |
exec ("sudo /usr/bin/systemctl restart dnsmasq-whitelist"); |
} |
} |
break; |
387,16 → 389,16 |
$tab=file(DNS_LOCAL_FILE); |
if ($tab) # not empty |
{ |
$line_exist=True; |
foreach ($tab as $line) |
{ |
if (preg_match ('/^address/', $line)) |
{ |
$line_exist=True; |
$field=explode("/", $line); |
$ip_addr=$field[1]; |
$host_name=$field[2]; |
echo "<tr><td>$ip_addr"; |
echo "<td>$host_name"; |
$host_name=$field[1]; |
$ip_addr=$field[2]; |
echo "<tr><td>$host_name"; |
echo "<td>$ip_addr"; |
echo "<td><input type='checkbox' name='$host_name'>"; |
echo "</tr>"; |
} |