diff --git a/includes/dhcp.php b/includes/dhcp.php index 007a89a8..b1838214 100755 --- a/includes/dhcp.php +++ b/includes/dhcp.php @@ -65,7 +65,12 @@ function DisplayDHCPConfig() foreach ($_POST['server'] as $server) { $config .= "server=$server".PHP_EOL; } - + if ($_POST['log-dhcp'] == "1") { + $config .= "log-dhcp".PHP_EOL; + } + if ($_POST['log-queries'] == "1") { + $config .= "log-queries".PHP_EOL; + } if ($_POST['DNS1']) { $config .= "dhcp-option=6," . $_POST['DNS1']; if ($_POST['DNS2']) { @@ -74,6 +79,7 @@ function DisplayDHCPConfig() $config .= PHP_EOL; } + $config .= "log-facility=/tmp/dnsmasq.log".PHP_EOL; $config .= "conf-dir=/etc/dnsmasq.d".PHP_EOL; file_put_contents("/tmp/dnsmasqdata", $config); diff --git a/installers/common.sh b/installers/common.sh index f0817664..23153e61 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -108,6 +108,13 @@ function create_hostapd_scripts() { sudo chmod 750 "$raspap_dir/hostapd/"*.sh || install_error "Unable to change file permissions" } +# Generate dnsmasq logfile +function create_dnsmasq_log() { + install_log "Creating dnsmasq logfile" + sudo touch /tmp/dnsmasq.log || install_error "Unable to create logfile /tmp/dnsmasq.log" + sudo chown dnsmasq:"$raspap_user" /tmp/dnsmasq.log || install_error "Unable to change file ownership" +} + # Generate lighttpd service control scripts function create_lighttpd_scripts() { install_log "Creating lighttpd control scripts" @@ -440,6 +447,7 @@ function install_raspap() { download_latest_files change_file_ownership create_hostapd_scripts + create_dnsmasq_log create_lighttpd_scripts move_config_file default_configuration diff --git a/templates/dhcp.php b/templates/dhcp.php index 5b15a23c..a8df0a5d 100755 --- a/templates/dhcp.php +++ b/templates/dhcp.php @@ -35,6 +35,7 @@ +
@@ -96,11 +97,8 @@
- - -
@@ -163,15 +161,29 @@
- - +
+
+
+

+ +

+
+ aria-describedby="log-dhcp-requests"> + +
+
+ aria-describedby="log-dhcp-queries"> + +
+
+

Client list

-
+
@@ -203,7 +215,10 @@
+
+

+
@@ -221,7 +236,7 @@
-

+
" class="form-control" autofocus="autofocus"> @@ -233,6 +248,7 @@
+
- + + +
+

+
+
+ '.htmlspecialchars($log, ENT_QUOTES).''; + ?> +
+
+
+ +