- Complete the first gateway support implementation,

- More tests needed!
This commit is contained in:
2025-08-26 19:14:05 +02:00
parent 7e05bc0ba0
commit 235076b6b9
3 changed files with 107 additions and 31 deletions

View File

@@ -208,7 +208,7 @@ vpn_job_tab_init()
tab_assign VPN_JOB_TAB "${job_id},Name" "${dst_name}"
tab_assign VPN_JOB_TAB "${job_id},PId" "0"
tab_assign VPN_JOB_TAB "${job_id},Cmd" "/usr/sbin/openvpn --config ${config_file} --dev ${dst_device} --daemon"
tab_assign VPN_JOB_TAB "${job_id},Cmd" "/usr/sbin/openvpn --config ${config_file} --daemon"
tab_assign VPN_JOB_TAB "${job_id},Date" ""
tab_assign VPN_JOB_NAME_IDX "${dst_name}" "${job_id}"
@@ -314,7 +314,8 @@ vpn_supervisor()
for job_id in ${VPN_JOB_ID_LIST}
do
vpn_job_tab_get "${job_id}"
${DEBUG} kill -0 "${job_pid}" 2>/dev/null
rc=$?
@@ -323,18 +324,20 @@ vpn_supervisor()
log_info "VPN" "Restarting Cmd: [${job_cmd}]..."
eval ${DEBUG} ${job_cmd}
job_pid="$( ps aux | grep "${job_cmd}" | grep -v grep | head -1 | awk '{print $2}')"
if [[ "${job_pid}" == "" ]]
then
job_pid=0
fi
tab_assign VPN_JOB_TAB "${job_id},PId" "${job_pid}"
tab_assign VPN_JOB_TAB "${job_id},Date" "$(date --rfc-3339=seconds -u)"
log_info "VPN" "PId: [${VPN_JOB_TAB["${job_id},PId"]}]!"
network_dst_name_ip_update "${job_name}" "0.0.0.0"
fi
done