From 92012a0b3db8e93b10db4137414073f0371ed8cc Mon Sep 17 00:00:00 2001 From: Lucas Christian Date: Sat, 10 Feb 2024 11:26:47 -0800 Subject: T5872: further fixes to ipsec dhcp exit hook --- src/etc/dhcp/dhclient-exit-hooks.d/99-ipsec-dhclient-hook | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/etc/dhcp') diff --git a/src/etc/dhcp/dhclient-exit-hooks.d/99-ipsec-dhclient-hook b/src/etc/dhcp/dhclient-exit-hooks.d/99-ipsec-dhclient-hook index 4dc52c6db..3f0c9cb7a 100755 --- a/src/etc/dhcp/dhclient-exit-hooks.d/99-ipsec-dhclient-hook +++ b/src/etc/dhcp/dhclient-exit-hooks.d/99-ipsec-dhclient-hook @@ -14,22 +14,22 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if [ "$reason" == "REBOOT" ] || [ "$reason" == "EXPIRE" ]; then - return 0 -fi - DHCP_HOOK_IFLIST="/tmp/ipsec_dhcp_waiting" if [ -f $DHCP_HOOK_IFLIST ] && [ "$reason" == "BOUND" ]; then if grep -qw $interface $DHCP_HOOK_IFLIST; then sudo rm $DHCP_HOOK_IFLIST sudo /usr/libexec/vyos/conf_mode/vpn_ipsec.py - return 0 + exit 0 fi fi -if [ "$old_ip_address" == "$new_ip_address" ] && [ "$reason" == "BOUND" ]; then - return 0 +if [ "$reason" == "RENEW" ] || [ "$reason" == "REBIND" ]; then + if [ "$old_ip_address" == "$new_ip_address" ]; then + exit 0 + fi +else + exit 0 fi python3 - <