aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/init.d
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2002-06-19 02:35:40 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2002-06-19 02:35:40 +0000
commita6b48f353a2b6e799b893cb0cce4db6ccacd9a03 (patch)
tree3ff15e070e8ca74e6aca37f815772ec2f59b4e2f /contrib/init.d
parent086b38c816adbabf3451bf9b7adee64bf2cb9c9b (diff)
Version 0.1.12 from FTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@462 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'contrib/init.d')
-rwxr-xr-xcontrib/init.d/rc.redhat.asterisk51
1 files changed, 51 insertions, 0 deletions
diff --git a/contrib/init.d/rc.redhat.asterisk b/contrib/init.d/rc.redhat.asterisk
new file mode 100755
index 000000000..09d5e269a
--- /dev/null
+++ b/contrib/init.d/rc.redhat.asterisk
@@ -0,0 +1,51 @@
+#!/bin/sh
+#
+# asterisk This shell script takes care of starting and stopping
+# asterisk (printer daemon).
+#
+# chkconfig: 2345 60 60
+# description: asterisk is the print daemon required for lpr to work properly. \
+# It is basically a server that arbitrates print jobs to printer(s).
+# processname: asterisk
+# config: /etc/printcap
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+[ -f /usr/sbin/asterisk ] || exit 0
+
+RETVAL=0
+
+# See how we were called.
+case "$1" in
+ start)
+ # Start daemons.
+ echo -n "Starting asterisk: "
+ daemon safe_asterisk
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/asterisk
+ ;;
+ stop)
+ # Stop daemons.
+ echo -n "Shutting down asterisk: "
+ killproc asterisk
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/asterisk
+ ;;
+ status)
+ status asterisk
+ RETVAL=$?
+ ;;
+ restart|reload)
+ $0 stop
+ $0 start
+ RETVAL=$?
+ ;;
+ *)
+ echo "Usage: asterisk {start|stop|restart|reload|status}"
+ exit 1
+esac
+
+exit $RETVAL