summaryrefslogtreecommitdiff
path: root/snmptt.init
diff options
context:
space:
mode:
authorPaweł Gołaszewski2004-06-24 08:52:34 (GMT)
committercvs2git2012-06-24 12:13:13 (GMT)
commite90116aa3a35f199bf959d83bd35b25af84f62bb (patch)
treef785f550e2219047a46bcd3c2462e81fb39702b2 /snmptt.init
downloadsnmptt-e90116aa3a35f199bf959d83bd35b25af84f62bb.zip
snmptt-e90116aa3a35f199bf959d83bd35b25af84f62bb.tar.gz
- taken from sources - to be rewritten
Changed files: snmptt.init -> 1.1
Diffstat (limited to 'snmptt.init')
-rw-r--r--snmptt.init83
1 files changed, 83 insertions, 0 deletions
diff --git a/snmptt.init b/snmptt.init
new file mode 100644
index 0000000..3644615
--- /dev/null
+++ b/snmptt.init
@@ -0,0 +1,83 @@
+#!/bin/bash
+# init file for snmptt
+# Alex Burger - 8/29/02
+# - 9/8/03 - Added snmptt.pid support to Stop function
+#
+# chkconfig: - 50 50
+# description: Simple Network Management Protocol (SNMP) Daemon
+#
+# processname: /usr/sbin/snmptt
+# pidfile: /var/run/snmptt.pid
+
+# source function library
+. /etc/init.d/functions
+
+OPTIONS="--daemon"
+RETVAL=0
+prog="snmptt"
+
+start() {
+ echo -n $"Starting $prog: "
+ daemon /usr/sbin/snmptt $OPTIONS
+ RETVAL=$?
+ echo
+ touch /var/lock/subsys/snmptt
+ return $RETVAL
+}
+
+stop() {
+ echo -n $"Stopping $prog: "
+ killproc /usr/sbin/snmptt 2>/dev/null
+ RETVAL=$?
+ echo
+ rm -f /var/lock/subsys/snmptt
+ if test -f /var/run/snmptt.pid ; then
+ [ $RETVAL -eq 0 ] && rm -f /var/run/snmptt.pid
+ fi
+ return $RETVAL
+}
+
+reload(){
+ echo -n $"Reloading config file: "
+ killproc snmptt -HUP
+ RETVAL=$?
+ echo
+ return $RETVAL
+}
+
+restart(){
+ stop
+ start
+}
+
+condrestart(){
+ [ -e /var/lock/subsys/snmptt ] && restart
+ return 0
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ restart
+ ;;
+ reload)
+ reload
+ ;;
+ condrestart)
+ condrestart
+ ;;
+ status)
+ status snmptt
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|condrestart|reload}"
+ RETVAL=1
+esac
+
+exit $RETVAL