Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hetzner: Tighter regex match for INTERFACE_DEVICE_PATH #18

Open
nh2 opened this issue Aug 6, 2022 · 0 comments
Open

hetzner: Tighter regex match for INTERFACE_DEVICE_PATH #18

nh2 opened this issue Aug 6, 2022 · 0 comments

Comments

@nh2
Copy link
Collaborator

nh2 commented Aug 6, 2022

I found a case on a Hetzner SX134 server with an addiitonal 10 G network interface that in

INTERFACE_DEVICE_PATH=$(udevadm info -e | grep -Po "(?<=^P: )(.*${RESCUE_INTERFACE})")

we need

-INTERFACE_DEVICE_PATH=$(udevadm info -e | grep -Po "(?<=^P: )(.*${RESCUE_INTERFACE})")
+INTERFACE_DEVICE_PATH=$(udevadm info -e | grep -Po "(?<=^P: )(.*${RESCUE_INTERFACE})$")

Otherwise we can get two maches:

# udevadm info -e | grep -P "(?<=^P: )(.*eth1)"
P: /devices/pci0000:00/0000:00:01.1/0000:01:00.0/net/eth1
P: /devices/pci0000:00/0000:00:01.1/0000:01:00.0/net/eth1/ixgbe-mdio-0000:01:00.0

when in fact we want to match only the first line.

@nh2 nh2 changed the title hetzner: hetzner: Tighter regex match for INTERFACE_DEVICE_PATH Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant