File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed
etc/service/inotify-networkmanager Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change 2525
2626echo " generated ${resolvconf_file} "
2727
28- # if /run/NetworkManager/resolv.conf is not mapped, sleep forever to
29- # avoid inotifywait complains
30- if [ ! -f /run/NetworkManager/resolv.conf ]; then
31- echo " NetworkManager's resolv.conf is not mapped, sleep forever"
32- exec sleep INFINITY
33- fi
28+ # create /run/NetworkManager directory to monitor it
29+ while [ " $( inotifywait --quiet --recursive --event MOVED_TO --format ' %f' /run/NetworkManager) " != " resolv.conf" ]; do
30+ # moved file is not resolv.conf, stay in loop
31+ continue
32+ done
3433
3534# this command will return on resolv.conf changes by NetworkManager, so
3635# this runit service script will be executed again (and dnsmasq will
3736# reload upstream nameservers if configuration has changed, as we are
3837# not using the '--no-poll' dnsmasq option)
39- exec inotifywait \
40- --event close_write \
41- --event move \
42- /run/NetworkManager/resolv.conf \
43- 2>&1
38+ echo " /run/NetworkManager/resolv.conf changes detected, refreshing DNS servers"
You can’t perform that action at this time.
0 commit comments