Skip to content

Commit

Permalink
fix: updated regex for ipv4 validation
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-fabian-pittroff committed Jan 25, 2024
1 parent 2c755c2 commit f1d4303
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ verifyVariables() {
fi

if [[ -n "$SERVER_IP" ]]; then
if ! [[ "$SERVER_IP" =~ ^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; then
if ! [[ "$SERVER_IP" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; then
error "SERVER_IP must be a valid ipv4 address (actual: $SERVER_IP)"
exit 1
fi
fi

if [[ -n "$STEAM_API_PUBLIC_IP" ]]; then
if ! [[ "$STEAM_API_PUBLIC_IP" =~ ^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; then
if ! [[ "$STEAM_API_PUBLIC_IP" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; then
error "STEAM_API_PUBLIC_IP must be a valid ipv4 address (actual: $STEAM_API_PUBLIC_IP)"
exit 1
fi
Expand Down

0 comments on commit f1d4303

Please sign in to comment.