Last active
August 29, 2015 14:18
-
-
Save randomessence/d67b2b4ad56ee45308c7 to your computer and use it in GitHub Desktop.
multirtru restart
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/vvkfk | |
# 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 | |
# autodl | |
if [[ -z "$(ps x | grep -v grep | grep -o -m 1 'irssi --home='"$HOME"'/.irssi-'"$suffix"'/')" ]] | |
then | |
screen -dmS autodl-"$suffix" irssi --home="$HOME/.irssi-$suffix"/ | |
echo "$(date +"%d.%m.%y@%H:%M:%S")" autodl-"$suffix" irssi >> ~/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 | |
# autodl | |
if [[ -z "$(ps x | grep -v grep | grep -o -m 1 'irssi --home='"$HOME"'/.irssi-'"$suffix"'/')" ]] | |
then | |
screen -dmS autodl-"$suffix" irssi --home="$HOME/.irssi-$suffix"/ | |
echo "$(date +"%d.%m.%y@%H:%M:%S")" autodl-"$suffix" irssi >> ~/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 | |
# autodl | |
if [[ -z "$(ps x | grep -v grep | grep -o -m 1 'irssi --home='"$HOME"'/.irssi-'"$suffix"'/')" ]] | |
then | |
screen -dmS autodl-"$suffix" irssi --home="$HOME/.irssi-$suffix"/ | |
echo "$(date +"%d.%m.%y@%H:%M:%S")" autodl-"$suffix" irssi >> ~/screenlogs.txt | |
else | |
: | |
fi | |
####################################################################################################################################### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment