]> git.parisson.com Git - deefuzzer.git/commitdiff
Added init.d and default config scripts to scripts folder (sets up deefuzzer as a...
authorachbed <github@achbed.org>
Sat, 29 Nov 2014 04:47:34 +0000 (22:47 -0600)
committerachbed <github@achbed.org>
Sat, 29 Nov 2014 04:47:34 +0000 (22:47 -0600)
Signed-off-by: achbed <github@achbed.org>
scripts/etc/default/deefuzzer [new file with mode: 0644]
scripts/etc/init.d/deefuzzer [new file with mode: 0644]

diff --git a/scripts/etc/default/deefuzzer b/scripts/etc/default/deefuzzer
new file mode 100644 (file)
index 0000000..4b0a59d
--- /dev/null
@@ -0,0 +1,22 @@
+# Defaults for deefuzzer initscript
+# sourced by /etc/init.d/deefuzzer
+# installed at /etc/default/deefuzzer by the maintainer scripts
+
+#
+# This is a POSIX shell fragment
+#
+
+# Full path to the server configuration file
+CONFIGFILE="/srv/pt/patestapes.com/deefuzzer.xml"
+
+# Name or ID of the user and group the daemon should run under
+USERID=deefuzzer
+GROUPID=staff
+
+# Edit /etc/deefuzzer.xml to match your environment.
+# Change this to true when done to enable the init.d script
+ENABLE=false
+
+# Uncomment below to make the service startup more verbose
+QUIET="--verbose"
+
diff --git a/scripts/etc/init.d/deefuzzer b/scripts/etc/init.d/deefuzzer
new file mode 100644 (file)
index 0000000..703b89a
--- /dev/null
@@ -0,0 +1,74 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          deefuzzer
+# Required-Start:    $remote_fs $network
+# Required-Stop:     $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Starts the deefuzzer streaming player
+### END INIT INFO
+#
+# deefuzzer
+#
+#               Written By Dennis Wallace (github@achbed.org)
+#               Based on code by Miquel van Smoorenburg <miquels@cistron.nl>.
+#               Modified for Debian
+#               by Ian Murdock <imurdock@gnu.ai.mit.edu>.
+#
+#               Further modified by Keegan Quinn <ice@thebasement.org>
+#               for use with Icecast 2
+#
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/local/bin/deefuzzer
+NAME=deefuzzer
+DESC=deefuzzer
+
+test -x $DAEMON || exit 0
+
+. /lib/lsb/init-functions
+
+# Defaults
+CONFIGFILE="/etc/deefuzzer/deefuzzer.xml"
+CONFIGDEFAULTFILE="/etc/default/deefuzzer"
+USERID=deefuzzer
+GROUPID=staff
+ENABLE="false"
+QUIET="--quiet"
+
+# Reads config file (will override defaults above)
+[ -r "$CONFIGDEFAULTFILE" ] && . $CONFIGDEFAULTFILE
+
+if [ "$ENABLE" != "true" ]; then
+        echo "$NAME daemon disabled - read $CONFIGDEFAULTFILE."
+        exit 0
+fi
+
+set -e
+
+case "$1" in
+  start)
+        echo -n "Starting $DESC: "
+        $DAEMON $CONFIGFILE &
+        echo "$NAME."
+        ;;
+  stop)
+        echo -n "Stopping $DESC: "
+        # Send TERM after 5 seconds, wait at most 30 seconds.
+        killall $NAME
+        echo "$NAME."
+        ;;
+  reload|force-reload|restart)
+        echo -n "Restarting $DESC: "
+        # Send TERM after 5 seconds, wait at most 30 seconds.
+        killall deefuzzer
+        $DAEMON $CONFIGFILE &
+        echo "$NAME."
+        ;;
+  *)
+        echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
+        exit 1
+        ;;
+esac
+
+exit 0