|
Lines 201-210
Link Here
|
| 201 |
|
201 |
|
| 202 |
# Rename it to the temporary name. |
202 |
# Rename it to the temporary name. |
| 203 |
# Then try several times to rename it to new name |
203 |
# Then try several times to rename it to new name |
| 204 |
nameif -r "$TMPNAME" "$OLDNAME" 2>/dev/null 1>&2 \ |
|
|
| 205 |
|| error_exit 11 "cannot rename interface to temporary name $TMPNAME" |
| 206 |
echo looping > $STAMPFILE |
| 207 |
declare -i LOOPS=0 |
204 |
declare -i LOOPS=0 |
|
|
205 |
for LOOPS in `seq 10`; do |
| 206 |
nameif -r "$TMPNAME" "$OLDNAME" 2>/dev/null 1>&2 && break |
| 207 |
test "$LOOPS" -lt 10 || error_exit 11 \ |
| 208 |
"cannot rename interface to temporary name $TMPNAME" |
| 209 |
usleep 100000 |
| 210 |
done |
| 211 |
info_mesg "renamed interface to temporary name $TMPNAME after $LOOPS tries" |
| 212 |
echo looping > $STAMPFILE |
| 213 |
LOOPS=0 |
| 208 |
while [ $MAXLOOPS -gt $LOOPS ] ; do |
214 |
while [ $MAXLOOPS -gt $LOOPS ] ; do |
| 209 |
: $((LOOPS++)) |
215 |
: $((LOOPS++)) |
| 210 |
if nameif -r "$NEWNAME" "$TMPNAME" 2>/dev/null 1>&2; then |
216 |
if nameif -r "$NEWNAME" "$TMPNAME" 2>/dev/null 1>&2; then |