diff options
author | tv <tv@also> | 2011-05-29 15:47:21 +0200 |
---|---|---|
committer | tv <tv@also> | 2011-05-29 15:47:21 +0200 |
commit | 12c77cdbfa4ec48d935af3ae7cf1118e38bec6e1 (patch) | |
tree | 2fdf8b557d2a2a1edaba2be569c2110c3822559f /noise/init.d | |
parent | edaa1d7f7a0ed33c019fce185b8aff7563498b6e (diff) |
lowered filesystem hierarchy--everything are modules
Diffstat (limited to 'noise/init.d')
-rwxr-xr-x | noise/init.d/noise | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/noise/init.d/noise b/noise/init.d/noise new file mode 100755 index 00000000..075e47d7 --- /dev/null +++ b/noise/init.d/noise @@ -0,0 +1,48 @@ +#!/bin/sh -e +### BEGIN INIT INFO +# Provides: noise +# Required-Start: $remote_fs $syslog dbus +# Required-Stop: $remote_fs $syslog dbus +# Default-Start: 2 3 4 5 +# Default-Stop: 1 +# Short-Description: Start the noise "Telnet" server +# Description: System mode startup script for +# the noise "Telnet" server. +### END INIT INFO + +DAEMON=/krebs/noise/noise-server + +test -x $DAEMON || exit 1 + +noise_pid() { + ps aux | grep tcpserver | grep noise-as-user | awk '{print$2}' +} + +noise_start() { + "$DAEMON" & +} + +noise_stop() { + kill "`noise_pid`" +} + +case "$1" in + start|stop) + noise_${1} + ;; + restart|reload|force-reload) + noise_stop + noise_start + ;; + #force-stop) ;; + status) + kill -s 0 "`noise_pid`" + exit $? + ;; + *) + echo "Usage: /etc/init.d/noise {start|stop|force-stop|restart|reload|force-reload|status}" + exit 1 + ;; +esac + +exit 0 |