mirror of
https://github.com/gtxaspec/wz_mini_hacks.git
synced 2024-11-21 21:17:22 +00:00
Update S09dnsmasq
Smarter way to detect resolv.conf rather than waiting on a sleep function and HOPING its there...
This commit is contained in:
parent
32dcd217b9
commit
c396f7b4c6
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user