hackbyte

raroifs.sh # rinse and repeat, only if necessary, steadily

Jul 28th, 2017
426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.56 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # raroifs.sh
  4. #
  5. # 2017-07-28 Daniel 'hackbyte' Mitzlaff
  6. #
  7. # rinse and repeat, only if necessary, steadily
  8. #
  9. # insert in $COMMAND the exact commandline of the cmd
  10. # you need to repeat or keep going..
  11. #
  12.  
  13. # $COMMAND is the command used to create the reverse ssh tunnel
  14. COMMAND="/bin/true is my command i need to start and keep goingd"
  15.  
  16. ##### done, no need to edit anything below. ;)
  17.  
  18. # Here the magic, no need to touch, it will do what you need
  19. while true ; do
  20.  pgrep -f -x "$COMMAND" > /dev/null 2>&1 || $COMMAND >/dev/null 2>&1 &
  21.  sleep 42
  22. done
Advertisement
Add Comment
Please, Sign In to add comment