From 077e4165316ff1158626809dceeabc8593fd0ead Mon Sep 17 00:00:00 2001 From: "Arnaud G. GIBERT" Date: Sat, 26 Jul 2025 00:27:10 +0200 Subject: [PATCH] - Adjust some log types, - Add some log info. --- usr/local/lib/dns.bash | 6 ------ usr/local/lib/network.bash | 7 +++++++ usr/local/lib/vpn.bash | 21 +++++++++++---------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/usr/local/lib/dns.bash b/usr/local/lib/dns.bash index c3dc136..62983d2 100644 --- a/usr/local/lib/dns.bash +++ b/usr/local/lib/dns.bash @@ -38,12 +38,6 @@ declare -g DNS_CACHE_LOCK declare -g DNS_CACHE_UPDATED=0 -#if [ ! -v LOG ] || [[ "${LOG}" == "" ]] -#then -# export LOG=":" -#fi - - diff --git a/usr/local/lib/network.bash b/usr/local/lib/network.bash index 2f52c53..73a396a 100644 --- a/usr/local/lib/network.bash +++ b/usr/local/lib/network.bash @@ -1184,11 +1184,15 @@ network_deinit() network_start() { + log_info "Network" "Starting network..." + network_table_init network_bridge_init network_forward_start + + log_info "Network" "Network started!" } @@ -1201,6 +1205,7 @@ network_start() network_stop() { + log_info "Network" "Stoping network..." network_forward_stop @@ -1208,6 +1213,8 @@ network_stop() network_table_deinit + log_info "Network" "Network stoped!" + return 0 } diff --git a/usr/local/lib/vpn.bash b/usr/local/lib/vpn.bash index 230d383..e68d4a4 100644 --- a/usr/local/lib/vpn.bash +++ b/usr/local/lib/vpn.bash @@ -33,15 +33,6 @@ declare -g VPN_STATUS_LOCK -#if [ ! -v LOG ] || [[ "${LOG}" == "" ]] -#then -# export LOG=":" -#fi - - - - - #-------------------------------------------------------------------------------------------------------------------------- # vpn_config_make #-------------------------------------------------------------------------------------------------------------------------- @@ -54,7 +45,7 @@ vpn_config_make() local mng_port=$(( 2330 + ${Device/tun/})) - log_info "VPN" "Creating config File: [${Config_File}] Device: [${Device}] Mng_Port: (${mng_port}) Target_Config: [${Target_Config}]" + log_trace "VPN" "Creating config File: [${Config_File}] Device: [${Device}] Mng_Port: (${mng_port}) Target_Config: [${Target_Config}]" ${DEBUG} cp -f ${VPN_TEMPLATE_FILE} ${Config_File} ${DEBUG} sed -e "s/TARGET-CFG/${Target_Config}-client.conf/" -e "s/VPN-DEVICE/${Device}/" -e "s/MNG-PORT/${mng_port}/" -i ${Config_File} @@ -291,6 +282,8 @@ vpn_supervisor() while true do + log_info "VPN" "New supervisor loop!" + for job_id in ${VPN_JOB_ID_LIST} do vpn_job_tab_get "${job_id}" @@ -417,6 +410,8 @@ vpn_start() { local daemon_pid + + log_info "VPN" "Starting VPN..." if [[ -s ${VPN_PID_FILE} ]] then @@ -439,6 +434,8 @@ vpn_start() else log_info "VPN" "Daemon already running PId: [${daemon_pid}]" fi + + log_info "VPN" "VPN started!" } @@ -454,6 +451,8 @@ vpn_stop() local daemon_pid + log_info "VPN" "Stoping VPN..." + if [[ -s ${VPN_PID_FILE} ]] then daemon_pid=$( cat ${VPN_PID_FILE}) @@ -478,6 +477,8 @@ vpn_stop() vpn_jobs_kill vpn_job_tab_deinit + + log_info "VPN" "VPN stoped!" }