source: freewrt/package/net-snmp/files/snmpd.init@ 4486a95

freewrt_1_0 freewrt_2_0
Last change on this file since 4486a95 was 583d755, checked in by Thorsten Glaser <tg@…>, 19 years ago
  • change the SYSV init system to add a target "autostart"
  • on system startup, call autostart instead of start
  • on autostart, check /etc/rc.conf for whether the service is enabled and act appropriately; fall through into start target
  • move some pre-startup checks into the start target
  • some whitespace cleanup, when it makes much sense (XXX when I get the person who wrote these scripts...)
  • optimise dropbear a little

ok and approved wbx@

git-svn-id: svn://www.freewrt.org/trunk/freewrt@191 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 406 bytes
Line 
1#!/bin/sh
2
3DEFAULT=/etc/default/snmpd
4LIB_D=/var/lib/snmp
5LOG_D=/var/log
6RUN_D=/var/run
7PID_F=$RUN_D/snmpd.pid
8
9[ -f $DEFAULT ] && . $DEFAULT
10
11case $1 in
12autostart|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 stop)
19 [ -f $PID_F ] && kill $(cat $PID_F)
20 ;;
21 *)
22 echo "usage: $0 (start|stop)"
23 exit 1
24esac
25exit $?
Note: See TracBrowser for help on using the repository browser.