Last active
July 1, 2021 05:10
-
-
Save metalefty/80d793d4c58a0a81f7a8df97c5127ff5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
notify 100 { | |
match "system" "IFNET"; | |
match "subsystem" "ue[0-9]+"; | |
match "type" "ATTACH"; | |
action "sh /etc/rename-netif.sh $subsystem"; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
00:11:22:33:44:55 eth0 | |
66:77:88:99:aa:bb eth1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
netifmap=/etc/netifmap | |
dev=$1 | |
if [ -z $dev ]; then | |
exit 1 | |
fi | |
mac=$(ifconfig $dev | grep '^\s\+ether' | awk '{print $2}') | |
name=$(grep ^$mac $netifmap | awk '{print $2}') | |
if [ -n $name ]; then | |
ifconfig $dev name $name | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment