From e75333e29d458b580d3ee86a15f9f3ba27d88fbc Mon Sep 17 00:00:00 2001 From: billz Date: Wed, 17 Nov 2021 18:20:03 +0000 Subject: [PATCH] Define RASPI_DHCPCD_LOG --- config/config.php | 1 + includes/adblock.php | 2 +- includes/defaults.php | 1 + includes/dhcp.php | 2 +- templates/dhcp/logging.php | 4 ++-- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/config/config.php b/config/config.php index c02ef442..95b43d41 100755 --- a/config/config.php +++ b/config/config.php @@ -15,6 +15,7 @@ define('RASPI_ADBLOCK_LISTPATH', '/etc/raspap/adblock/'); define('RASPI_ADBLOCK_CONFIG', RASPI_DNSMASQ_PREFIX.'adblock.conf'); define('RASPI_HOSTAPD_CONFIG', '/etc/hostapd/hostapd.conf'); define('RASPI_DHCPCD_CONFIG', '/etc/dhcpcd.conf'); +define('RASPI_DHCPCD_LOG', '/var/log/dnsmasq.log'), define('RASPI_WPA_SUPPLICANT_CONFIG', '/etc/wpa_supplicant/wpa_supplicant.conf'); define('RASPI_HOSTAPD_CTRL_INTERFACE', '/var/run/hostapd'); define('RASPI_WPA_CTRL_INTERFACE', '/var/run/wpa_supplicant'); diff --git a/includes/adblock.php b/includes/adblock.php index 034971b7..45983695 100755 --- a/includes/adblock.php +++ b/includes/adblock.php @@ -78,7 +78,7 @@ function DisplayAdBlockConfig() $adblock_custom_content = file_get_contents(RASPI_ADBLOCK_LISTPATH .'custom.txt'); $adblock_log = ''; - exec('sudo chmod o+r /tmp/dnsmasq.log'); + exec('sudo chmod o+r '.RASPI_DHCPCD_LOG); $handle = fopen("/tmp/dnsmasq.log", "r"); if ($handle) { while (($line = fgets($handle)) !== false) { diff --git a/includes/defaults.php b/includes/defaults.php index c098ae55..ec49636f 100755 --- a/includes/defaults.php +++ b/includes/defaults.php @@ -20,6 +20,7 @@ $defaults = [ 'RASPI_ADBLOCK_CONFIG' => RASPI_DNSMASQ_PREFIX.'adblock.conf', 'RASPI_HOSTAPD_CONFIG' => '/etc/hostapd/hostapd.conf', 'RASPI_DHCPCD_CONFIG' => '/etc/dhcpcd.conf', + 'RASPI_DHCPCD_LOG' => '/var/log/dnsmasq.log', 'RASPI_WPA_SUPPLICANT_CONFIG' => '/etc/wpa_supplicant/wpa_supplicant.conf', 'RASPI_HOSTAPD_CTRL_INTERFACE' => '/var/run/hostapd', 'RASPI_WPA_CTRL_INTERFACE' => '/var/run/wpa_supplicant', diff --git a/includes/dhcp.php b/includes/dhcp.php index 53a33535..3e53017a 100755 --- a/includes/dhcp.php +++ b/includes/dhcp.php @@ -228,7 +228,7 @@ function updateDnsmasqConfig($iface,$status) // write default 090_raspap.conf $config = '# RaspAP default config'.PHP_EOL; - $config .='log-facility=/tmp/dnsmasq.log'.PHP_EOL; + $config .='log-facility='.RASPI_DHCPCD_LOG.PHP_EOL; $config .='conf-dir=/etc/dnsmasq.d'.PHP_EOL; // handle log option if ($_POST['log-dhcp'] == "1") { diff --git a/templates/dhcp/logging.php b/templates/dhcp/logging.php index ce451e6d..46307536 100644 --- a/templates/dhcp/logging.php +++ b/templates/dhcp/logging.php @@ -16,8 +16,8 @@
'.htmlspecialchars($log, ENT_QUOTES).''; } else { echo '';