Skip to content

Commit

Permalink
change '\:' to ':' in IPv6 validation grep
Browse files Browse the repository at this point in the history
- newer versions of grep emit messages about it being not neccessary;
  this output can break us in some situations
  • Loading branch information
k-rister committed Oct 30, 2023
1 parent 423d45b commit 223325c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion endpoints/base
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ function is_ip() {

if echo "$ip" | grep -E --silent '[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}'; then
return 0
elif echo "$ip" | grep -E --silent '[[:xdigit:]]{1,4}\:[[:xdigit:]]{1,4}\:[[:xdigit:]]{1,4}\:[[:xdigit:]]{1,4}\:[[:xdigit:]]{1,4}\:[[:xdigit:]]{1,4}\:[[:xdigit:]]{1,4}\:[[:xdigit:]]'; then
elif echo "$ip" | grep -E --silent '[[:xdigit:]]{1,4}:[[:xdigit:]]{1,4}:[[:xdigit:]]{1,4}:[[:xdigit:]]{1,4}:[[:xdigit:]]{1,4}:[[:xdigit:]]{1,4}:[[:xdigit:]]{1,4}:[[:xdigit:]]'; then
return 0
else
return 1
Expand Down

0 comments on commit 223325c

Please sign in to comment.