From c396f7b4c618c1c0bb8679bb15cfe8790c3bdb30 Mon Sep 17 00:00:00 2001 From: sideup66 <47700565+sideup66@users.noreply.github.com> Date: Thu, 24 Oct 2024 02:24:31 -0400 Subject: [PATCH] Update S09dnsmasq Smarter way to detect resolv.conf rather than waiting on a sleep function and HOPING its there... --- SD_ROOT/wz_mini/etc/network.d/S09dnsmasq | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SD_ROOT/wz_mini/etc/network.d/S09dnsmasq b/SD_ROOT/wz_mini/etc/network.d/S09dnsmasq index 1c72a31..41991de 100644 --- a/SD_ROOT/wz_mini/etc/network.d/S09dnsmasq +++ b/SD_ROOT/wz_mini/etc/network.d/S09dnsmasq @@ -16,7 +16,10 @@ dnsmasq_launch() { if [[ "$ENABLE_LOCAL_DNS" == "true" ]]; then echo "wait for resolv.conf creation from iCamera" - sleep 5 + while [ ! -f /tmp/resolv.conf ] + do + sleep .2 + done #kill the system dnsmasq if present dmon_pid=$(pgrep -f "dmon.*dnsmasq") if [ -n "$dmon_pid" ]; then @@ -28,7 +31,6 @@ dnsmasq_launch() { else /opt/wz_mini/bin/dnsmasq -C /opt/wz_mini/etc/dnsmasq.conf fi - sleep 5 #mount the resolv.conf file as read only. Something (ICamera?) randomly seems to change it. mount --bind /opt/wz_mini/etc/resolv.conf /tmp/resolv.conf mount -o bind,remount,ro /tmp/resolv.conf