]>
Commit | Line | Data |
---|---|---|
eaf1d53a AM |
1 | #!/bin/sh |
2 | # | |
3 | # $Id: ifup-neigh,v 1.1 2002/08/11 17:05:08 misiek Exp $ | |
4 | # | |
5 | # adds static arps for device $DEVICE | |
6 | ||
7 | . /etc/sysconfig/network | |
8 | . /etc/rc.d/init.d/functions | |
9 | . /etc/sysconfig/network-scripts/functions.network | |
10 | ||
11 | DEV=$1 | |
12 | ||
13 | if [ -z "$DEV" ]; then | |
14 | nls "Usage: %s <device name>" "ifup-neigh" >&2 | |
15 | exit 1 | |
16 | fi | |
17 | ||
18 | if [ ! -f /etc/sysconfig/static-arp ]; then | |
19 | exit 0 | |
20 | fi | |
21 | ||
22 | if [ -f "/etc/sysconfig/interfaces/ifcfg-$DEV" ] ; then | |
23 | CONFIG="/etc/sysconfig/interfaces/ifcfg-$DEV" | |
24 | else | |
25 | CONFIG="$DEV" | |
26 | fi | |
27 | ||
28 | source_config | |
29 | ||
30 | # set all major variables | |
31 | setup_ip_param | |
32 | ||
33 | get_ppp_device_and_pid | |
34 | ||
35 | # note the trailing white space character in the grep gets rid of aliases | |
36 | egrep "^($DEVICE|any)[[:blank:]]" /etc/sysconfig/static-arp | while read iface mac ip state args; do | |
37 | if is_no "$IPV4_NETWORKING"; then | |
38 | continue | |
39 | fi | |
40 | [ -z "$state" ] && state="stale" | |
41 | /sbin/ip neigh replace $ip lladdr $mac nud $state dev $DEVICE | |
42 | done | |
43 | ||
44 | ||
45 | # This must be last line ! | |
46 | # vi:syntax=sh:tw=78:ts=8:sw=4 |