From ea389e1a1323feaa9c85e70b2535dc8d4473203e Mon Sep 17 00:00:00 2001 From: billz Date: Thu, 5 Mar 2020 10:34:46 +0000 Subject: [PATCH 1/3] Add create_dnsmasq_log --- installers/common.sh | 8 ++++++++ 1 file changed, 8 insertions(+) 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 From 90b922c43215df3a2cc39a4b43053a00c4e8f31d Mon Sep 17 00:00:00 2001 From: billz Date: Thu, 5 Mar 2020 10:35:40 +0000 Subject: [PATCH 2/3] Update with dnsmasq logfile output --- includes/dhcp.php | 8 +++++++- templates/dhcp.php | 45 +++++++++++++++++++++++++++++++++++++++------ 2 files changed, 46 insertions(+), 7 deletions(-) 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/templates/dhcp.php b/templates/dhcp.php index 5b15a23c..3ec22cec 100755 --- a/templates/dhcp.php +++ b/templates/dhcp.php @@ -35,6 +35,7 @@ +
@@ -96,7 +97,7 @@
- + @@ -163,15 +164,29 @@ - - +
+
+
+

+ +

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

Client list

-
+
@@ -203,7 +218,10 @@
+
+

+
@@ -221,7 +239,7 @@
-

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

+
+
+ '.htmlspecialchars($log, ENT_QUOTES).''; + ?> +
+
+
+ +
From ddd8b53fdfabfc6d52478fa218bc98bd483159bf Mon Sep 17 00:00:00 2001 From: billz Date: Thu, 5 Mar 2020 12:43:14 +0000 Subject: [PATCH 3/3] Minor: label change --- templates/dhcp.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/templates/dhcp.php b/templates/dhcp.php index 3ec22cec..a8df0a5d 100755 --- a/templates/dhcp.php +++ b/templates/dhcp.php @@ -35,7 +35,7 @@ - +
@@ -97,11 +97,8 @@
- -
-
@@ -166,7 +163,7 @@
-
+