From fa800d7eacd153953bef8677178d695f824389db Mon Sep 17 00:00:00 2001 From: "Arnaud G. GIBERT" Date: Sat, 26 Jul 2025 10:48:47 +0200 Subject: [PATCH] - Build VPN confing now only on VPN start. --- usr/local/lib/vpn.bash | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/usr/local/lib/vpn.bash b/usr/local/lib/vpn.bash index e68d4a4..f86a201 100644 --- a/usr/local/lib/vpn.bash +++ b/usr/local/lib/vpn.bash @@ -55,6 +55,33 @@ vpn_config_make() +#-------------------------------------------------------------------------------------------------------------------------- +# vpn_config_make_all +#-------------------------------------------------------------------------------------------------------------------------- + +vpn_config_make_all() +{ + local job_id + local config_file + + + for job_id in ${VPN_JOB_ID_LIST} + do + vpn_job_tab_get "${job_id}" + + network_dst_tab_name_lookup "${job_name}" + network_dst_tab_get "${dst_id}" + + config_file="${VPN_CONFIG_FILE/DEVICE/${dst_device}}" + + vpn_config_make "${config_file}" "${dst_device}" "${dst_config}" + done +} + + + + + #-------------------------------------------------------------------------------------------------------------------------- # vpn_job_tab_load #-------------------------------------------------------------------------------------------------------------------------- @@ -186,7 +213,7 @@ vpn_job_tab_init() tab_assign VPN_JOB_NAME_IDX "${dst_name}" "${job_id}" - vpn_config_make "${config_file}" "${dst_device}" "${dst_config}" +# vpn_config_make "${config_file}" "${dst_device}" "${dst_config}" log_trace "VPN" "Loading config: Id: [${job_id}] Name: [${dst_name}] Cmd: [${VPN_JOB_TAB["${job_id},Cmd"]}]" @@ -425,6 +452,8 @@ vpn_start() if [[ "${daemon_pid}" == "0" ]] || [[ $rc != 0 ]] then + config_make_all + vpn_supervisor & daemon_pid=$!