port over more init scripts
[openwrt/svn-archive/archive.git] / libs / net-snmp / files / snmpd.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
3
4 DEFAULT=/etc/default/snmpd
5 LIB_D=/var/lib/snmp
6 LOG_D=/var/log
7 RUN_D=/var/run
8 PID_F=$RUN_D/snmpd.pid
9
10 [ -f $DEFAULT ] && . $DEFAULT
11
12 start() {
13 [ -d $LIB_D ] || mkdir -p $LIB_D
14 [ -d $LOG_D ] || mkdir -p $LOG_D
15 [ -d $RUN_D ] || mkdir -p $RUN_D
16 snmpd $OPTIONS
17 }
18
19 stop() {
20 [ -f $PID_F ] && kill $(cat $PID_F)
21 }
22