dhcpd.init 442 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh /etc/rc.common
  2. START=65
  3. lease_file=/tmp/dhcpd.leases
  4. config_file=/etc/dhcpd.conf
  5. pid_file=/var/run/dhcpd.pid
  6. start() {
  7. if [ ! -e $lease_file ]; then
  8. touch $lease_file
  9. fi
  10. /usr/sbin/dhcpd -q -cf $config_file -lf $lease_file -pf $pid_file $dhcp_ifs
  11. if [ $? -ne 0 ]; then
  12. return 1
  13. fi
  14. }
  15. stop() {
  16. if [ ! -e $pid_file ]; then
  17. return 1
  18. fi
  19. kill -9 `cat $pid_file`
  20. if [ $? -ne 0 ]; then
  21. return 1
  22. fi
  23. rm $pid_file
  24. }