init script cleanup, use /etc/rc.d/ for enabled scripts, /etc/init.d/<pkgname> (enabl...
[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
11 start() {
12 [ -f $DEFAULT ] && . $DEFAULT
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