Lines 1-4
Link Here
|
1 |
#!/bin/sh -e |
1 |
#!/bin/bash -e |
2 |
|
2 |
|
3 |
# This script is run to create persistent network device naming rules |
3 |
# This script is run to create persistent network device naming rules |
4 |
# based on properties of the device. |
4 |
# based on properties of the device. |
Lines 42-47
Link Here
|
42 |
|
42 |
|
43 |
. /lib/udev/rule_generator.functions |
43 |
. /lib/udev/rule_generator.functions |
44 |
|
44 |
|
|
|
45 |
[ -f /etc/sysconfig/write_net_rules] && . /etc/sysconfig/write_net_rules |
46 |
|
45 |
interface_name_taken() { |
47 |
interface_name_taken() { |
46 |
local value="$(find_all_rules 'NAME=' $INTERFACE)" |
48 |
local value="$(find_all_rules 'NAME=' $INTERFACE)" |
47 |
if [ "$value" ]; then |
49 |
if [ "$value" ]; then |
Lines 117-122
Link Here
|
117 |
basename=${INTERFACE%%[0-9]*} |
119 |
basename=${INTERFACE%%[0-9]*} |
118 |
match="$match, KERNEL==\"$basename*\"" |
120 |
match="$match, KERNEL==\"$basename*\"" |
119 |
|
121 |
|
|
|
122 |
ETHERDEFAULT=${ETHERDEFAULT:-ether} |
123 |
|
124 |
if [ "$ETHERDEFAULT" != "eth" ]; then |
125 |
if [ "$basename" = "eth" ]; then |
126 |
basename="$ETHERDEFAULT" |
127 |
fi |
128 |
if [[ $INTERFACE_NAME =~ (eth)([0-9]+) ]]; then |
129 |
INTERFACE_NAME="$ETHERDEFAULT${BASH_REMATCH[2]}" |
130 |
fi |
131 |
if [[ $INTERFACE =~ (eth)([0-9]+) ]]; then |
132 |
INTERFACE="$ETHERDEFAULT${BASH_REMATCH[2]}" |
133 |
fi |
134 |
fi |
135 |
|
120 |
if [ "$INTERFACE_NAME" ]; then |
136 |
if [ "$INTERFACE_NAME" ]; then |
121 |
# external tools may request a custom name |
137 |
# external tools may request a custom name |
122 |
COMMENT="$COMMENT (custom name provided by external tool)" |
138 |
COMMENT="$COMMENT (custom name provided by external tool)" |