dhcp-script.sh 839 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/sh
  2. [ -f "$USER_DHCPSCRIPT" ] && . "$USER_DHCPSCRIPT" "$@"
  3. case "$1" in
  4. add)
  5. export ACTION="add"
  6. export MACADDR="$2"
  7. export IPADDR="$3"
  8. export HOSTNAME="$4"
  9. exec /sbin/hotplug-call dhcp
  10. ;;
  11. del)
  12. export ACTION="remove"
  13. export MACADDR="$2"
  14. export IPADDR="$3"
  15. export HOSTNAME="$4"
  16. exec /sbin/hotplug-call dhcp
  17. ;;
  18. old)
  19. export ACTION="update"
  20. export MACADDR="$2"
  21. export IPADDR="$3"
  22. export HOSTNAME="$4"
  23. exec /sbin/hotplug-call dhcp
  24. ;;
  25. arp-add)
  26. export ACTION="add"
  27. export MACADDR="$2"
  28. export IPADDR="$3"
  29. exec /sbin/hotplug-call neigh
  30. ;;
  31. arp-del)
  32. export ACTION="remove"
  33. export MACADDR="$2"
  34. export IPADDR="$3"
  35. exec /sbin/hotplug-call neigh
  36. ;;
  37. tftp)
  38. export ACTION="add"
  39. export TFTP_SIZE="$2"
  40. export TFTP_ADDR="$3"
  41. export TFTP_PATH="$4"
  42. exec /sbin/hotplug-call tftp
  43. ;;
  44. esac