From d8488476c589528468f30486a5cd6784ab44626b Mon Sep 17 00:00:00 2001 From: ghe0 Date: Sat, 11 Jan 2025 23:03:31 +0200 Subject: [PATCH] changing regex from extended to perl --- scripts/start_qemu_vm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/start_qemu_vm.sh b/scripts/start_qemu_vm.sh index e0694b1..ecbddb8 100755 --- a/scripts/start_qemu_vm.sh +++ b/scripts/start_qemu_vm.sh @@ -30,8 +30,8 @@ add_nft_rules() { # TODO: This will handle only one IP per VM. If you add multiple IPs, fix this. # Also, we wish you good luck. We know this code is complicated. We tried, ok? - ipv4_addr=$(echo $PARAMS | grep -m 1 -oE "detee_net_eth${nic_index}=[0-9]{1,3}\.[0-9a-f\.]+" | cut -d "=" -f2 ) - ipv6_addr=$(echo $PARAMS | grep -m 1 -oE "detee_net_eth${nic_index}=[0-9a-f]{1,4}\:[0-9a-f\:]+" | cut -d "=" -f2 ) + ipv4_addr=$(echo $PARAMS | grep -m 1 -oP "detee_net_eth${nic_index}=[0-9]{1,3}\.[0-9a-f\.]+" | cut -d "=" -f2 ) + ipv6_addr=$(echo $PARAMS | grep -m 1 -oP "detee_net_eth${nic_index}=[0-9a-f]{1,4}\:[0-9a-f\:]+" | cut -d "=" -f2 ) [[ -n "$ipv4_addr" ]] && { nft add rule netdev deteemacvtap ${ifname}_in ip daddr != $ipv4_addr drop