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