diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2013-04-12 17:12:52 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2013-04-12 17:12:52 -0300 |
commit | 5ab9c19c8e45a067ee0880e4148b2f1492e152f7 (patch) | |
tree | 0cfaccff0a5bed4f6ece09e4ad601bbca32ac1c9 /files/start.sh | |
download | puppet-pyroscope-5ab9c19c8e45a067ee0880e4148b2f1492e152f7.tar.gz puppet-pyroscope-5ab9c19c8e45a067ee0880e4148b2f1492e152f7.tar.bz2 |
Initial import
Diffstat (limited to 'files/start.sh')
-rw-r--r-- | files/start.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/files/start.sh b/files/start.sh new file mode 100644 index 0000000..249d393 --- /dev/null +++ b/files/start.sh @@ -0,0 +1,20 @@ +#! /bin/bash +if [ "$TERM" = "${TERM%-256color}" ]; then + export TERM="$TERM-256color" +fi +export LANG=en_US.UTF-8 +umask 0027 +cd $(dirname $0) +export RT_SOCKET=$PWD/.scgi_local +test -S $RT_SOCKET && lsof $RT_SOCKET >/dev/null && { echo "rTorrent already running"; exit 1; } +test ! -e $RT_SOCKET || rm $RT_SOCKET + +_at_exit() { + test -z "$TMUX" || tmux set-w automatic-rename on >/dev/null + stty sane + test ! -e $RT_SOCKET || rm $RT_SOCKET +} +trap _at_exit INT TERM EXIT +test -z "$TMUX" || tmux rename-w rT-PS + +rtorrent -n -o import=$PWD/rtorrent.rc |