hackbyte icon

raroif.sh # rinse and repeat, only if necessary

hackbyte | PRO | 07/28/17 05:22:40 PM UTC | 0 ⭐ | 388 👁️ | Never ⏰ | []
Bash |

520 B

|

None

|

0 👍

/

0 👎

#!/bin/sh
 
# raroif.sh
#
# 2017-07-28 Daniel 'hackbyte' Mitzlaff
#
# rinse and repeat, only if necessary
#
# insert in $COMMAND the exact commandline of the cmd
# you need to repeat or keep going..
#
 
# $COMMAND is the command used to create the reverse ssh tunnel
COMMAND="/bin/true is my command i need to start and keep going"
 
##### done, no need to edit anything below. ;)
 
# Here the magic, no need to touch, it will do what you need
pgrep -f -x "$COMMAND" > /dev/null 2>&1 || $COMMAND >/dev/null 2>&1 &

Comments