1
0
mirror of https://github.com/elisspace/rtinst.git synced 2026-08-30 08:02:14 +00:00
Files
rtinst/rtcheck
2015-10-14 19:10:51 +01:00

20 lines
360 B
Bash

#!/bin/bash
# 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