Skip to content

Instantly share code, notes, and snippets.

@randomessence
Created April 11, 2015 23:47
Show Gist options
  • Save randomessence/ec574963acc60d143c99 to your computer and use it in GitHub Desktop.
Save randomessence/ec574963acc60d143c99 to your computer and use it in GitHub Desktop.
# wget -qO ~/instances http://git.io/vvkIu
# crontab -e
# * * * * * bash -l ~/instances
#######################################################################################################################################
suffix="1"
# rtorrent
if [[ -z "$(ps x | grep -v grep | grep -o '/bin/bash -e /usr/local/bin/rtorrent -n -o import='"$HOME"'/.rtorrent-'"$suffix"'.rc')" ]]
then
screen -fa -dmS rtorrent-"$suffix" rtorrent -n -o import=~/.rtorrent-"$suffix".rc
echo "$(date +"%d.%m.%y@%H:%M:%S")" rtorrent-"$suffix" >> ~/screenlogs.txt
else
:
fi
#######################################################################################################################################
#######################################################################################################################################
suffix="2"
# rtorrent
if [[ -z "$(ps x | grep -v grep | grep -o '/bin/bash -e /usr/local/bin/rtorrent -n -o import='"$HOME"'/.rtorrent-'"$suffix"'.rc')" ]]
then
screen -fa -dmS rtorrent-"$suffix" rtorrent -n -o import=~/.rtorrent-"$suffix".rc
echo "$(date +"%d.%m.%y@%H:%M:%S")" rtorrent-"$suffix" >> ~/screenlogs.txt
else
:
fi
#######################################################################################################################################
#######################################################################################################################################
suffix="3"
# rtorrent
if [[ -z "$(ps x | grep -v grep | grep -o '/bin/bash -e /usr/local/bin/rtorrent -n -o import='"$HOME"'/.rtorrent-'"$suffix"'.rc')" ]]
then
screen -fa -dmS rtorrent-"$suffix" rtorrent -n -o import=~/.rtorrent-"$suffix".rc
echo "$(date +"%d.%m.%y@%H:%M:%S")" rtorrent-"$suffix" >> ~/screenlogs.txt
else
:
fi
#######################################################################################################################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment