Created
April 11, 2015 23:47
-
-
Save randomessence/ec574963acc60d143c99 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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