diff options
| author | My Name | 2014-12-11 00:47:01 +0100 |
|---|---|---|
| committer | My Name | 2014-12-11 00:47:01 +0100 |
| commit | dd9a6048bb109494072d94281701ad9734d2b275 (patch) | |
| tree | 116e23217a56169d55c1fae19ddc65b47fac6737 /initrc | |
| parent | 510493a04ccf84b301a271b56687ecf729b2c61a (diff) | |
| download | dotfiles-dd9a6048bb109494072d94281701ad9734d2b275.tar.gz | |
Added ZNC init + monit script, rtorrent + zabbix-server monit config and fixed typos
Diffstat (limited to 'initrc')
| -rwxr-xr-x | initrc/rtorrent | 36 | ||||
| -rwxr-xr-x | initrc/znc | 37 |
2 files changed, 73 insertions, 0 deletions
diff --git a/initrc/rtorrent b/initrc/rtorrent new file mode 100755 index 0000000..7f36a74 --- /dev/null +++ b/initrc/rtorrent @@ -0,0 +1,36 @@ +#!/bin/bash +set -e + +RTORRENTUSER="horus" +NAME=rtorrent +DESC="rtorrent, a cli bittorrent client." + +DAEMON="/usr/bin/rtorrent" +SCREEN="/usr/bin/screen" + +PIDFILE="/var/run/${NAME}.pid" + +START_OPTS="--start --background --make-pidfile --pidfile ${PIDFILE} --chuid $RTORRENTUSER --exec $SCREEN -- -DmUS ${NAME} ${DAEMON}" +END_OPTS="--stop --pidfile ${PIDFILE}" + +case "$1" in + start) + echo "Starting ${DESC}" + start-stop-daemon $START_OPTS + ;; + stop) + echo "Stopping ${DESC}" + start-stop-daemon $END_OPTS + rm -f "${PIDFILE}" + ;; + restart) + "$0" stop + rm -f "${PIDFILE}" + sleep 1 + "$0" start + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac diff --git a/initrc/znc b/initrc/znc new file mode 100755 index 0000000..7f7bcb0 --- /dev/null +++ b/initrc/znc @@ -0,0 +1,37 @@ +#!/bin/bash +set -e + +USER="horus" +DATADIR="/home/${USER}/.znc" +NAME=znc +DESC="ZNC, the IRC Bouncer" + +DAEMON="/usr/bin/znc" +DAEMON_OPTS="--foreground --datadir=$DATADIR" + +PIDFILE="/var/run/${NAME}.pid" + +START_OPTS="--start --background --make-pidfile --pidfile ${PIDFILE} --chuid $USER" +END_OPTS="--stop --pidfile ${PIDFILE}" + +case "$1" in + start) + echo "Starting ${DESC}" + start-stop-daemon $START_OPTS --exec ${DAEMON} -- $DAEMON_OPTS + ;; + stop) + echo "Stopping ${DESC}" + start-stop-daemon $END_OPTS + rm -f "${PIDFILE}" + ;; + restart) + "$0" stop + rm -f "${PIDFILE}" + sleep 1 + "$0" start + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac |
