1
0
mirror of https://github.com/elisspace/rtinst.git synced 2026-08-29 15:44:06 +00:00
Files
rtinst/scripts/rtcheck
2017-06-19 12:09:04 +01:00

28 lines
662 B
Bash
Executable File

#!/bin/bash
######################################################################
#
# Copyright (c) 2015 arakasi72 (https://github.com/arakasi72)
#
# --> Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
#
######################################################################
# rTorrent Auto Restart
PATH=/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/bin:/sbin
FILE="$HOME/rtorrent/.session/rtorrent.lock"
service_running(){
pgrep -fx -u $LOGNAME $1 > /dev/null
}
for arg do
if ! ( service_running $arg ); then
if [[ $arg = "rtorrent" && -a $FILE ]]; then
rm -f $FILE
fi
screen -d -m -S $arg $arg
fi
done