Skip to content

Instantly share code, notes, and snippets.

@randomessence
Last active August 29, 2015 14:18
Show Gist options
  • Save randomessence/d67b2b4ad56ee45308c7 to your computer and use it in GitHub Desktop.
Save randomessence/d67b2b4ad56ee45308c7 to your computer and use it in GitHub Desktop.
multirtru restart
# 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