summaryrefslogtreecommitdiff
path: root/src/etc/dhcp
diff options
context:
space:
mode:
authorDarin Kuo <darinkuo@gmail.com>2023-07-13 19:24:55 -0700
committerDarin Kuo <darinkuo@gmail.com>2023-07-14 08:30:32 -0700
commit5b67c9266c334186dd567cb453f05b6f8528aaf4 (patch)
treeaf0a9dabedbbd55ed65e2071ef301fd316bf100c /src/etc/dhcp
parentac60fe7d1840b8768542ee4b3f28f46544c290f2 (diff)
downloadvyos-1x-5b67c9266c334186dd567cb453f05b6f8528aaf4.tar.gz
vyos-1x-5b67c9266c334186dd567cb453f05b6f8528aaf4.zip
dhclient: T5358: Use return in 99-ipsec-dhclient-hook
Use return instead of exit in 99-dhclient-exit-hook to allow subsequent unnumbered hooks to run (like rfc3442-classless-routes). Hooks are sourced, not executed.
Diffstat (limited to 'src/etc/dhcp')
-rwxr-xr-xsrc/etc/dhcp/dhclient-exit-hooks.d/99-ipsec-dhclient-hook8
1 files changed, 4 insertions, 4 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 1f1926e17..a4738eb39 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
@@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if [ "$reason" == "REBOOT" ] || [ "$reason" == "EXPIRE" ]; then
- exit 0
+ return 0
fi
DHCP_HOOK_IFLIST="/tmp/ipsec_dhcp_waiting"
@@ -24,12 +24,12 @@ 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
- exit 0
+ return 0
fi
fi
if [ "$old_ip_address" == "$new_ip_address" ] && [ "$reason" == "BOUND" ]; then
- exit 0
+ return 0
fi
python3 - <<PYEND
@@ -83,4 +83,4 @@ if __name__ == '__main__':
call('sudo swanctl -q')
exit(0)
-PYEND \ No newline at end of file
+PYEND