#!/bin/sh
# raroifs.sh
#
# 2017-07-28 Daniel 'hackbyte' Mitzlaff
#
# rinse and repeat, only if necessary, steadily
#
# 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 goingd"
##### done, no need to edit anything below. ;)
# Here the magic, no need to touch, it will do what you need
while true ; do
pgrep -f -x "$COMMAND" > /dev/null 2>&1 || $COMMAND >/dev/null 2>&1 &
sleep 42
done
Comments