aboutsummaryrefslogtreecommitdiff
path: root/files/start.sh
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-04-12 17:12:52 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-04-12 17:12:52 -0300
commit5ab9c19c8e45a067ee0880e4148b2f1492e152f7 (patch)
tree0cfaccff0a5bed4f6ece09e4ad601bbca32ac1c9 /files/start.sh
downloadpuppet-pyroscope-5ab9c19c8e45a067ee0880e4148b2f1492e152f7.tar.gz
puppet-pyroscope-5ab9c19c8e45a067ee0880e4148b2f1492e152f7.tar.bz2
Initial import
Diffstat (limited to 'files/start.sh')
-rw-r--r--files/start.sh20
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