1 |
#!/bin/sh |
2 |
|
3 |
[ -z "$INTERFACE" ] && exit 0 |
4 |
|
5 |
CFG=/etc/sysconfig/network-scripts/ifcfg-$INTERFACE |
6 |
[ -r $CFG ] && exit 0 |
7 |
|
8 |
[ -r /etc/sysconfig/udev_net ] && . /etc/sysconfig/udev_net |
9 |
[ -n "$BLACKLIST_ALL" ] && eval "case $INTERFACE in $BLACKLIST_ALL) exit 1;; esac" |
10 |
[ -n "$BLACKLIST_PERSISTENT" ] && eval "case $INTERFACE in $BLACKLIST_PERSISTENT) exit 1;; esac" |
11 |
|
12 |
# eagle-usb/firewire create a fake ethX interface |
13 |
[ "$PHYSDEVDRIVER" = "ne2k-pci" ] || /usr/sbin/ethtool $INTERFACE &>/dev/null || exit 0 |
14 |
|
15 |
# conform to network service (AUTOMATIC_IFCFG) |
16 |
[ -r /etc/sysconfig/network ] && . /etc/sysconfig/network |
17 |
|
18 |
if [ "$AUTOMATIC_IFCFG" != no ]; then |
19 |
debug_mesg creating config file for $INTERFACE |
20 |
cat > $CFG <<EOF |
21 |
DEVICE=$INTERFACE |
22 |
BOOTPROTO=dhcp |
23 |
ONBOOT=yes |
24 |
EOF |
25 |
fi |