Guest User

Untitled

a guest
Dec 13th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #!/bin/sh
  2. #wait for some program to clear a lock before doing stuff
  3. while [ -f /var/run/example.lock ]; do
  4. sleep 1
  5. done
  6. #do stuff
  7.  
  8. #/bin/sh
  9. inotifywait -e delete_self /var/run/example.lock
  10. #do stuff
  11.  
  12. take the lock
  13. use the resource
  14. release the lock
Add Comment
Please, Sign In to add comment