Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save artistro08/603e9ad96c0c892d6d484fe5aecbe6ab to your computer and use it in GitHub Desktop.
Save artistro08/603e9ad96c0c892d6d484fe5aecbe6ab to your computer and use it in GitHub Desktop.
watcher.sh
#!/bin/bash
inotifywait -m ~/.sites -e create -e moved_to |
while read dir action file; do
export file
echo "The file '$file' appeared in directory '$dir' via '$action'"
echo -e "\n127.0.0.1 $file.test\c" | powershell.exe gsudo wsl tee -a /mnt/c/Windows/System32/drivers/etc/hosts
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment