changing regex from extended to perl
This commit is contained in:
parent
65126fcdac
commit
d8488476c5
@ -30,8 +30,8 @@ add_nft_rules() {
|
|||||||
|
|
||||||
# TODO: This will handle only one IP per VM. If you add multiple IPs, fix this.
|
# 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?
|
# 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 )
|
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 -oE "detee_net_eth${nic_index}=[0-9a-f]{1,4}\:[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" ]] && {
|
[[ -n "$ipv4_addr" ]] && {
|
||||||
nft add rule netdev deteemacvtap ${ifname}_in ip daddr != $ipv4_addr drop
|
nft add rule netdev deteemacvtap ${ifname}_in ip daddr != $ipv4_addr drop
|
||||||
|
Loading…
Reference in New Issue
Block a user