From fd3ccd6ffe17964da84a529fd12855a58f6d21dd Mon Sep 17 00:00:00 2001 From: sideup66 <47700565+sideup66@users.noreply.github.com> Date: Tue, 10 Sep 2024 00:05:09 -0400 Subject: [PATCH] Update S09dnsmasq Added logic to use the newly included dnsmasq process from Wyze on newer firmwares. First, the script will detect the newer dnsmasq process if present and kill it, next, it will determine if the newer dnsmasq binary IS present and start dnsmasq back up using our config from wz_mini. If not, it will simply launch wz_mini's build of dnsmasq. This effectively fixes the script for newer versions of the Wyze firmware. --- SD_ROOT/wz_mini/etc/network.d/S09dnsmasq | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/SD_ROOT/wz_mini/etc/network.d/S09dnsmasq b/SD_ROOT/wz_mini/etc/network.d/S09dnsmasq index b416c39..9703b7c 100644 --- a/SD_ROOT/wz_mini/etc/network.d/S09dnsmasq +++ b/SD_ROOT/wz_mini/etc/network.d/S09dnsmasq @@ -17,7 +17,17 @@ dnsmasq_launch() { if [[ "$ENABLE_LOCAL_DNS" == "true" ]]; then echo "wait for resolv.conf creation from iCamera" sleep 5 - dnsmasq -C /opt/wz_mini/etc/dnsmasq.conf + #kill the system dnsmasq if present + dmon_pid=$(pgrep -f "dmon.*dnsmasq") + if [ -n "$dmon_pid" ]; then + kill $dmon_pid + fi + #figure out if there is a system dnsmasq bin present and use that if so, otherwise use wz_mini's binary + if [ -f /system/bin/dnsmasq ]; then + /system/bin/dnsmasq -C /opt/wz_mini/etc/dnsmasq.conf & + else + /opt/wz_mini/bin/dnsmasq -C /opt/wz_mini/etc/dnsmasq.conf + fi rm -f /tmp/resolv.conf cp /opt/wz_mini/etc/resolv.conf /tmp/resolv.conf echo "dnsmasq enabled"