@@ -31,7 +31,7 @@ function getDirs() {
31
31
DIRS=()
32
32
local TARRAY=()
33
33
34
- readarray -t TARRAY <<< " $(find /run -path '/run/user' -prune -o ! -readable -prune -o -name 'resolv.conf' -print)"
34
+ readarray -t TARRAY <<< " $(find /run -path '/run/user' -prune -o -path '/run/media' -prune -o ! -readable -prune -o -name 'resolv.conf' -print)"
35
35
36
36
# Find nameserver files in the /run/NetworkManager folder (as they do not have a standard name)
37
37
if [[ ! -f " /run/NetworkManager/resolv.conf" && -d " /run/NetworkManager" ]]; then
@@ -59,10 +59,10 @@ function updateNameservers() {
59
59
60
60
cat " $DNSHEAD " | unique | tee " $DNSFILE " & > /dev/null
61
61
cat " ${FILES[@]} " | grep -i ' ^nameserver' | grep -v ' 127.0.0.1' | unique | tee -a " $DNSFILE " & > /dev/null
62
-
62
+
63
63
symlinkResolv
64
-
65
- cat " ${FILES[@]} " | grep -v ' ^nameserver' | grep -v ' ^#' | unique | tee " $VRESOLV " & > /dev/null
64
+
65
+ cat " ${FILES[@]} " | grep -v ' ^nameserver' | grep -v ' ^#' | unique | tee " $VRESOLV " & > /dev/null
66
66
echo ' nameserver 127.0.0.1' >> " $VRESOLV "
67
67
68
68
# Add "search" and "domain" directives to /etc/resolv.conf
@@ -83,19 +83,19 @@ function getFiles() {
83
83
if [[ " $DIR " = " /run/resolvconf/interface" ]]; then
84
84
readarray -t TARRAY <<< " $(find ${DIR} ! -readable -prune -o -type f -print)"
85
85
fi
86
-
86
+
87
87
FILES=(${FILES[@]} ${TARRAY[@]} )
88
- done
88
+ done
89
89
}
90
90
91
91
function watchDirs() {
92
92
local WATCHERS=(${DIRS[@]} " $DNSHEAD " )
93
93
94
94
# Log which directories are being watched
95
- echo " Watching the following directories for changes:" >> " $LOGFILE "
96
-
95
+ echo " Watching the following directories for changes:" >> " $LOGFILE "
96
+
97
97
for DIR in " ${DIRS[@]} " ; do
98
- echo " - $DIR " >> " $LOGFILE "
98
+ echo " - $DIR " >> " $LOGFILE "
99
99
done
100
100
101
101
# Watch directories for changes in files
@@ -136,7 +136,7 @@ function start {
136
136
137
137
function stop {
138
138
echo -e " Stopping Valet DNS Watcher...\n"
139
-
139
+
140
140
pkill -f " inotifywait -q -m -e modify"
141
141
142
142
rm " $LOGFILE " && touch " $LOGFILE "
@@ -154,7 +154,7 @@ function restart {
154
154
fi
155
155
156
156
echo -e " Starting Valet DNS Watcher..."
157
-
157
+
158
158
main
159
159
160
160
if [[ $( pgrep -f ' inotifywait -q -m -e modify' ) ]]; then
@@ -188,4 +188,4 @@ case "$1" in
188
188
echo " Usage: $0 {start|stop|restart|status}"
189
189
esac
190
190
191
- exit 0
191
+ exit 0
0 commit comments