Skip to content

Commit 7107098

Browse files
committed
Minor fix
- Fixed a minor issue when checking for the VPN_DNS_NAME variable. Compare it with the value of the first "leftcert" in ikev2.conf. Multiple "leftcert" lines may exist in certain use cases, such as defining static IPs for IKEv2 client(s).
1 parent 2ca03f1 commit 7107098

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ else
730730
fi
731731

732732
if [ "$status" = 2 ] && [ -n "$VPN_DNS_NAME" ]; then
733-
server_addr_cur=$(grep -s "leftcert=" /etc/ipsec.d/ikev2.conf | cut -f2 -d=)
733+
server_addr_cur=$(grep -s "leftcert=" /etc/ipsec.d/ikev2.conf | cut -f2 -d= | head -n 1)
734734
if [ "$VPN_DNS_NAME" != "$server_addr_cur" ]; then
735735
cat <<'EOF'
736736
Warning: The VPN_DNS_NAME variable you specified has no effect

0 commit comments

Comments
 (0)