#!/bin/bash
#-----------------------------------------------------------------------------------------------------------------------------------
#
# Rx3 VPN Admin Board CGI
#
# Copyright (C) 2025-2026 Arnaud G. GIBERT
# mailto:arnaud@rx3.net
#
# This is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; If not, see
#
"
echo "
"
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 [[ ( "${ADMIN}" == "true") || ( "${dst_type}" != "1") ]] then if [[ "${FORMAT}" == "html" ]] then echo -n "${dst_name} | " else echo -n "${dst_name};" fi 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 [[ "${USER}" != "" ]]
then
echo -n "All VPN"
echo -n " "
fi
if [[ "${STATUS}" != "" ]]
then
echo -n "All Status"
fi
echo ""
echo "
"
echo "
"
echo "
"
printf " Page generated in %d.%03d seconds\n" "${elaps_sec}" "${elaps_mili}"
echo "
" echo " Rx3 Admin" echo "
" echo "" echo ""
echo "
"
echo "
"
echo "
"
echo "