Changeset 5449


Ignore:
Timestamp:
2006-11-06T14:54:52+01:00 (11 years ago)
Author:
florian
Message:

Add init script from exobyte #924

File:
1 edited

Legend:

Unmodified
Added
Removed
  • packages/net/bind/files/named.init

    r4917 r5449  
    11#!/bin/sh /etc/rc.common 
    2 # Copyright (C) 2006 OpenWrt.org 
     2 
     3lease_file=/tmp/dhcpd.leases 
     4config_file=/etc/dhcpd.conf 
     5pid_file=/var/run/dhcpd.pid 
    36 
    47start() { 
    5         if [ -f /etc/bind/named.conf ]; then 
    6                 named -c /etc/bind/named.conf 
    7         fi 
     8  echo Starting isc-dhcpd 
     9 
     10  if [ ! -e $lease_file ]; then 
     11    echo "  Creating $lease_file" 
     12    touch $lease_file 
     13  fi 
     14 
     15  /usr/sbin/dhcpd -cf $config_file -lf $lease_file 
     16 
     17  if [ $$ -eq 0 ] 
     18  then 
     19    echo "  isc-dhcpd failed to start" 
     20  fi 
    821} 
    922 
    1023stop() { 
    11         killall named 
     24  echo "Stopping isc-dhcpd" 
     25  if [ -e $pid_file ] 
     26  then 
     27    kill `cat $pid_file` 
     28 
     29    if [ $$ -eq 0 ] 
     30    then 
     31      echo "  PID " `cat $pid_file` not found 
     32      echo "  Is the DHCP server running?" 
     33    fi 
     34 
     35    rm $pid_file 
     36 
     37    else 
     38    echo "  $pid_file not found" 
     39  fi 
    1240} 
Note: See TracChangeset for help on using the changeset viewer.