Guest User

Untitled

a guest
Dec 17th, 2015
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. # install mouse if not exists
  4. function mkmouse () {
  5. echo no mouse install found
  6. sleep 1
  7. echo compiling mouse in 5 seconds, CTRL-C to stop...
  8. sleep 5
  9. gcc mouse.c -lm -w -o3 -o mouse && strip ./mouse
  10. }
  11.  
  12. function runmouse () {
  13. if [[ -f $1 ]]; then
  14. cp $1 mouse.007
  15. else
  16. echo $1 > mouse.007
  17. fi
  18. RET=$(`which mouse` guessbot.m02 | head -n1)
  19. exit $RET
  20. }
  21.  
  22. if [[ $# != 1 ]]; then
  23. echo -e "\n\tUsage: $0 <board>"
  24. echo -e "\twhere <board> is a file to open OR a string representing a board\n"
  25. exit 1
  26. fi
  27.  
  28. if [[ -f ./mouse ]] || [[ -f /usr/bin/mouse ]]; then
  29. runmouse $1
  30. else
  31. mkmouse && runmouse
  32. fi
Advertisement
Add Comment
Please, Sign In to add comment