|
|
|
@ -5,14 +5,14 @@ local util = require("luci.util")
|
|
|
|
|
|
|
|
|
|
-- Function to check if AnyConnect (openconnect-vpn) is active
|
|
|
|
|
local function is_vpn_connected()
|
|
|
|
|
local status = sys.call("ip link show openconnect-vpn >/dev/null 2>&1")
|
|
|
|
|
local status = sys.call("ip link show vpn-vpn >/dev/null 2>&1")
|
|
|
|
|
return (status == 0) and "Connected" or "Disconnected"
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- Function to get RX and TX statistics for openconnect-vpn
|
|
|
|
|
local function get_vpn_traffic()
|
|
|
|
|
local rx, tx = "N/A", "N/A"
|
|
|
|
|
local f = io.popen("ifconfig openconnect-vpn | grep 'RX bytes' 2>/dev/null")
|
|
|
|
|
local f = io.popen("ifconfig vpn-vpn | grep 'RX bytes' 2>/dev/null")
|
|
|
|
|
if f then
|
|
|
|
|
local output = f:read("*a")
|
|
|
|
|
f:close()
|
|
|
|
|