Commit 43d97337 authored by Matthew Smith's avatar Matthew Smith
Browse files

Bug: Change hardcoded path to existing var for status log

parent 903788c2
......@@ -148,11 +148,11 @@ function create_Html_Status() {
function echo_status() {
grep CLIENT_LIST /var/lib/openvpn-server/openvpn/status-sol1-server.log | head -n1 | sed -e "s/HEADER,//g" | awk -F "," '{printf "%-20s %-18s %-18s %-25s %14s %12s Routes\n",$2,$3,$4,$7,$5,$6}'
grep CLIENT_LIST "$status_log" | head -n1 | sed -e "s/HEADER,//g" | awk -F "," '{printf "%-20s %-18s %-18s %-25s %14s %12s Routes\n",$2,$3,$4,$7,$5,$6}'
for client in $(grep ^CLIENT_LIST /var/lib/openvpn-server/openvpn/status-sol1-server.log | awk -F "," '{print $2}'); do
row=$(grep ^CLIENT_LIST /var/lib/openvpn-server/openvpn/status-sol1-server.log | sed -e 's/:[0-9]\{3,5\}//g' | grep "$client")
routes=$(grep ^ROUTING_TABLE /var/lib/openvpn-server/openvpn/status-sol1-server.log | grep "$client" | awk -F "," '{printf "%s|",$2}')
for client in $(grep ^CLIENT_LIST "$status_log" | awk -F "," '{print $2}'); do
row=$(grep ^CLIENT_LIST "$status_log" | sed -e 's/:[0-9]\{3,5\}//g' | grep "$client")
routes=$(grep ^ROUTING_TABLE "$status_log" | grep "$client" | awk -F "," '{printf "%s|",$2}')
echo "$row,${routes::-1}" | awk -F "," '{printf "%-20s %-18s %-18s %-25s %11.0f MB %9.0f MB %2s\n",$2,$3,$4,$7,$5/1024/1024,$6/1024/1024,$10}'
done
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment