- Build VPN confing now only on VPN start.

This commit is contained in:
2025-07-26 10:48:47 +02:00
parent 077e416531
commit fa800d7eac

View File

@@ -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=$!