#!/bin/bash time_in=$(date +%s%N) . /usr/local/lib/network.bash #-------------------------------------------------------------------------------------------------------------------------- # Header Print #-------------------------------------------------------------------------------------------------------------------------- Header_Print () { case "${format}" in "html") echo "Content-type: text/html" echo "" echo "" echo "" echo "
" echo " " echo " " echo " " echo " " echo " " if [[ "${cmd_status}" == "" ]] then echo ""
echo "
"
echo "
| # | Name | Type | Device | IP | Host Name | Config | Table | Status | Bytes In | Bytes Out | UpTime |
| ${dst_id} | ${dst_name} | ${NETWORK_DST_TYPE[${dst_type}]} | ${dst_device} | ${dst_ip} | ${dst_host_name} | ${dst_config:--} | ${dst_table} | "
if [[ "${dst_status}" == 1 ]]
then
echo -n " | "
else
echo -n "${dst_bytes_received:--} | ${dst_bytes_sent:--} | ${dst_uptime:--} | " else echo "${dst_id};${dst_name};${NETWORK_DST_TYPE[${dst_type}]};${dst_device};${dst_ip};${dst_host_name};${dst_config};${dst_table};${dst_status};${dst_bytes_received};${dst_bytes_sent};${dst_uptime}" fi done if [[ "${format}" == "html" ]] then echo "
"
echo "
"
echo "
| "
if [[ "${dst_table}" == "${src_table}" ]]
then
echo -n " | "
else
echo -n " | "
if [[ ( ${admin} == "true") || ( "${REMOTE_USER}" == "${src_owner}") ]]
then
echo -n " |
"
echo "
"
echo "
| # | Type | IP | Host Name | Device | Status | " else echo "TABLE: Source_Routing_Board" echo -n "#;Type;IP;Host Name;Status;Device;" fi for dst_id in ${NETWORK_DST_ID_LIST} do network_dst_tab_get ${dst_id} if [[ "${format}" == "html" ]] then echo -n "${dst_host_name} | " else echo -n "${dst_host_name};" fi done if [[ "${format}" == "html" ]] then echo "Port Range | From Port | To Port | Owner | Bytes In | Bytes Out | UpTime | Last Seen |
"
echo "
"
echo "
"
echo "
"
echo "
"
echo "
"
echo "
"
echo "
"
echo ""
echo " Date: $(/bin/date)
"
echo "
"
echo "
"
echo "
"
echo -n " "
if [[ " ${ADMIN_USER_LIST} " == *" ${REMOTE_USER} "* ]]
then
if [[ "${admin}" == "true" ]]
then
echo -n "Non Admin Mode"
else
echo -n "Admin Mode"
fi
echo -n " "
fi
if [[ "${filter}" != "" ]]
then
echo -n "All VPN"
fi
echo ""
echo "
"
echo "
"
echo "
"
printf "Page generated in %d.%03d seconds" ${elaps_sec} ${elaps_mili}
echo "
" echo " Rx3 Admin" echo "
" echo "" echo ""
echo "
"
echo "
"
echo "
"
echo "