-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Configure narrowing=yes for IPsec connections"
This reverts commit e0bfa7e.
- Loading branch information
1 parent
7f7957a
commit 3c4cbbd
Showing
2 changed files
with
27 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
timeout=120 | ||
elapsed=0 | ||
desiredconn="" | ||
establishedsa="" | ||
|
||
if [ ! -e "/etc/ipsec.d/openshift.conf" ]; then | ||
exit 0 | ||
fi | ||
|
||
while [[ $elapsed -lt $timeout ]]; do | ||
desiredconn=$(grep -E '^\s*conn\s+' /etc/ipsec.d/openshift.conf | grep -v '%default' | awk '{print $2}' | tr ' ' '\n' | sort | tr '\n' ' ') | ||
establishedsa=$(ipsec showstates | grep STATE_V2_ESTABLISHED_CHILD_SA | grep -o '"[^"]*"' | sed 's/"//g' | tr ' ' '\n' | sort | uniq | tr '\n' ' ') | ||
if [ "$desiredconn" == "$establishedsa" ]; then | ||
echo "IPsec SAs are established for desired connections" | ||
break | ||
else | ||
echo "IPsec SAs are not established yet, waiting" | ||
sleep 2s | ||
fi | ||
elapsed=$((elapsed + 2)) | ||
done | ||
|
||
if [[ $elapsed -ge $timeout ]]; then | ||
echo "Timed out waiting, some connections are not established, desired conns $desiredconn, established conns $establishedsa" | ||
fi |