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

Commit d5251d5

Browse files
committed
Correct valet-dns race condition with PID
1 parent c3ca2ad commit d5251d5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

cli/stubs/valet-dns

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ function watchDirs() {
102102
inotifywait -q -m -e modify -e create -e delete --format "%w%f" "${WATCHERS[@]}" | while read change; do
103103
updateNameservers
104104
done &
105-
106-
pgrep -f 'inotifywait -q -m -e modify' | tee "${WORKDIR}/watch.pid" &>/dev/null
107105
}
108106

109107
function main() {
@@ -131,6 +129,7 @@ function start {
131129
else
132130
echo -e "Starting Valet DNS Watcher..."
133131
main
132+
sleep 2 && echo $(pgrep -f 'inotifywait -q -m -e modify') > "${WORKDIR}/watch.pid"
134133
echo -e "Valet DNS Watcher started succesfully."
135134
fi
136135
}
@@ -164,7 +163,6 @@ function restart {
164163
}
165164

166165
function status {
167-
echo -e "Watching for changes in the following directories:\n"
168166
cat '/opt/valet-linux/watch.log'
169167
}
170168

0 commit comments

Comments
 (0)