- Start new external VPN management implementation.
This commit is contained in:
@@ -759,6 +759,87 @@ network_table_set()
|
||||
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------------------------------------------------
|
||||
# network_dst_address_refresh
|
||||
#--------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
network_dst_address_refresh()
|
||||
{
|
||||
local dst_id="$1"
|
||||
local dst_host_name="$2"
|
||||
local dst_ip_old="$3"
|
||||
|
||||
local dst_ip_new
|
||||
local proxy_host="proxy${dst_id}.not.rx3"
|
||||
local proxy_port=8080
|
||||
|
||||
|
||||
dst_ip_new=$( nc ${proxy_host} ${proxy_port})
|
||||
|
||||
if [[ "${dst_ip_old}" != "${dst_ip_new}" ]]
|
||||
then
|
||||
${LOG} "Update ${dst_host_name}: Old: [${dst_ip_old}] New: [${dst_ip_new}]"
|
||||
${DEBUG} /usr/local/sbin/ip_host_update "${dst_host_name/.*}" "${dst_host_name#*.}" "${dst_ip_new}" 60
|
||||
|
||||
tab_assign NETWORK_DST_TAB "${dst_id},IP" "${dst_ip_new}"
|
||||
else
|
||||
${LOG} "Skiping ${dst_host_name}: IP: [${dst_ip_old}]"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------------------------------------------------
|
||||
# network_dst_address_refresh
|
||||
#--------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
network_dst_address_refresh()
|
||||
{
|
||||
local dst_id="$1"
|
||||
local dst_host_name="$2"
|
||||
local dst_ip_old="$3"
|
||||
|
||||
local dst_ip_new
|
||||
local proxy_host="proxy${dst_id}.not.rx3"
|
||||
local proxy_port=8080
|
||||
|
||||
|
||||
dst_ip_new=$( nc ${proxy_host} ${proxy_port})
|
||||
|
||||
if [[ "${dst_ip_old}" != "${dst_ip_new}" ]]
|
||||
then
|
||||
${LOG} "Update ${dst_host_name}: Old: [${dst_ip_old}] New: [${dst_ip_new}]"
|
||||
${DEBUG} /usr/local/sbin/ip_host_update "${dst_host_name/.*}" "${dst_host_name#*.}" "${dst_ip_new}" 60
|
||||
|
||||
tab_assign NETWORK_DST_TAB "${dst_id},IP" "${dst_ip_new}"
|
||||
else
|
||||
${LOG} "Skiping ${dst_host_name}: IP: [${dst_ip_old}]"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------------------------------------------------
|
||||
# network_dst_address_refresh_all
|
||||
#--------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
network_dst_address_refresh_all()
|
||||
{
|
||||
for dst_id in ${NETWORK_DST_ID_LIST}
|
||||
do
|
||||
network_dst_tab_get ${dst_id}
|
||||
network_dst_address_refresh ${dst_id} ${dst_host_name} ${dst_ip}
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------------------------------------------------
|
||||
# bridge_up
|
||||
#--------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user