All pastes #2097120 Raw Edit

Untitled

public text v1 · immutable
#2097120 ·published 2011-12-29 03:43 UTC
rendered paste body
!/bin/sh
PATH=/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/bin:/sbin
SERVICE="rtorrent"
FILE="/home/$USER/.rtorrent.lock"
if pgrep -u $USER $SERVICE > /dev/null
then
echo "$SERVICE service running, everything is fine"
else
rm -f ${FILE}
echo "$SERVICE is not running, starting $SERVICE" && screen -d -m -S seedbox $SERVICE
fi