summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Christian <lucas@lucasec.com>2024-02-10 11:26:47 -0800
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-03-28 16:09:39 +0000
commit40b0986d66c3a0891dedbedc273b5485e5a8ca3a (patch)
treeba4578ae7d479dde0e431330a239cf5775d47eb3
parent781807e732da80b967019649cd79d4721e19f26d (diff)
downloadvyos-1x-40b0986d66c3a0891dedbedc273b5485e5a8ca3a.tar.gz
vyos-1x-40b0986d66c3a0891dedbedc273b5485e5a8ca3a.zip
T5872: further fixes to ipsec dhcp exit hook
(cherry picked from commit 92012a0b3db8e93b10db4137414073f0371ed8cc)
-rwxr-xr-xsrc/etc/dhcp/dhclient-exit-hooks.d/99-ipsec-dhclient-hook14
1 files changed, 7 insertions, 7 deletions
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 <http://www.gnu.org/licenses/>.
-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 - <<PYEND