Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
- 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).
  • Loading branch information
hwdsl2 committed Sep 7, 2024
1 parent 2ca03f1 commit 7107098
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ else
fi

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

0 comments on commit 7107098

Please sign in to comment.