1 |
On Mar 15, 2012 2:24 AM, "Pandu Poluan" <pandu@××××××.info> wrote: |
2 |
> |
3 |
> Here's a prototype script to ensure that certain NICs will always end up |
4 |
the way you want it named: |
5 |
> |
6 |
|
7 |
#!/bin/sh |
8 |
mac="$( cat /proc/net/arp | awk -V dev="$MDEV" 'NR==1{next} $6==dev {print |
9 |
$4}')" |
10 |
name="$(cat /etc/nic.conf | awk -V mac="$mac" '$1==mac {print $2}')" |
11 |
[ "$name" ] && mv /dev/$MDEV /dev/$name |
12 |
exit 0 |
13 |
|
14 |
> |
15 |
> (Prototype, because I don't have access to a Linux box atm, so I can't |
16 |
test) |
17 |
> |
18 |
|
19 |
Eh, forgot the input file for the second awk :-P |
20 |
|
21 |
Rgds, |