down network interfaces behind USB ports#21
Conversation
| fi | ||
|
|
||
| # Check if the interface is bridged by USB (PCI -> USB -> ethernet) | ||
| if [[ "$1" =~ enp0s[0-9]{1,}f[0-9]u[0-9]{1,} ]] ; then |
There was a problem hiding this comment.
Should p0 be changed to p[0-9]+ to account for multiple domains? On my desktop I have enp10s0 as one of my interfaces, though it is the motherboard's integrated controller.
I appreciate the detailed comment explaining the naming btw!
There was a problem hiding this comment.
Curious - why is your desktop using domain 10? My assumption is anything besides 0 would be for virtualization.
I'll make the change.
There was a problem hiding this comment.
Bus address of the ethernet controller is 0a:00.0 (on domain 0, shown with lspci -D)
0000:0a:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 05)
0a should be slot number, so I'm not sure why systemd is doing p10 instead of s10
In any case, thanks for applying the change!
There was a problem hiding this comment.
Probably a bug in systemd. Maybe already fixed in newer versions. At any rate, no harm in matching all PCI domains.
In the second commit, I also used one-or-more matching + instead of {1,}. For some reason during my testing I tried ?, but that's 0-or-1 matching, so of course it would not work. Thank you for jostling my brain.
Minh has an oddball ethernet interface that he would like downed at boot-up.