Skip to content
This repository was archived by the owner on Dec 9, 2019. It is now read-only.

Commit 8dcf765

Browse files
committed
Remove /run/media from watch path
1 parent 2f25993 commit 8dcf765

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

cli/stubs/valet-dns

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function getDirs() {
3131
DIRS=()
3232
local TARRAY=()
3333

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)"
3535

3636
# Find nameserver files in the /run/NetworkManager folder (as they do not have a standard name)
3737
if [[ ! -f "/run/NetworkManager/resolv.conf" && -d "/run/NetworkManager" ]]; then
@@ -59,10 +59,10 @@ function updateNameservers() {
5959

6060
cat "$DNSHEAD" | unique | tee "$DNSFILE" &>/dev/null
6161
cat "${FILES[@]}" | grep -i '^nameserver' | grep -v '127.0.0.1' | unique | tee -a "$DNSFILE" &>/dev/null
62-
62+
6363
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
6666
echo 'nameserver 127.0.0.1' >> "$VRESOLV"
6767

6868
# Add "search" and "domain" directives to /etc/resolv.conf
@@ -83,19 +83,19 @@ function getFiles() {
8383
if [[ "$DIR" = "/run/resolvconf/interface" ]]; then
8484
readarray -t TARRAY <<< "$(find ${DIR} ! -readable -prune -o -type f -print)"
8585
fi
86-
86+
8787
FILES=(${FILES[@]} ${TARRAY[@]})
88-
done
88+
done
8989
}
9090

9191
function watchDirs() {
9292
local WATCHERS=(${DIRS[@]} "$DNSHEAD")
9393

9494
# 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+
9797
for DIR in "${DIRS[@]}"; do
98-
echo " - $DIR" >> "$LOGFILE"
98+
echo " - $DIR" >> "$LOGFILE"
9999
done
100100

101101
# Watch directories for changes in files
@@ -136,7 +136,7 @@ function start {
136136

137137
function stop {
138138
echo -e "Stopping Valet DNS Watcher...\n"
139-
139+
140140
pkill -f "inotifywait -q -m -e modify"
141141

142142
rm "$LOGFILE" && touch "$LOGFILE"
@@ -154,7 +154,7 @@ function restart {
154154
fi
155155

156156
echo -e "Starting Valet DNS Watcher..."
157-
157+
158158
main
159159

160160
if [[ $(pgrep -f 'inotifywait -q -m -e modify') ]]; then
@@ -188,4 +188,4 @@ case "$1" in
188188
echo "Usage: $0 {start|stop|restart|status}"
189189
esac
190190

191-
exit 0
191+
exit 0

0 commit comments

Comments
 (0)