Created
March 27, 2010 19:35
-
-
Save fahadsadah/346307 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OpenVPN CLIENT LIST | |
Updated,Sat Mar 27 19:35:56 2010 | |
Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since | |
somebody,84.237.99.16:4324,631428,703980,Fri Mar 26 12:19:51 2010 | |
ROUTING TABLE | |
Virtual Address,Common Name,Real Address,Last Ref | |
10.156.210.6,somebody,84.237.99.16:4324,Fri Mar 26 12:19:54 2010 | |
GLOBAL STATS | |
Max bcast/mcast queue length,0 | |
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file = File.new("/etc/openvpn/openvpn-status.log") | |
people = 0 | |
while (line = file.gets) do | |
if people == 1 then | |
people = 0 if line == "ROUTING TABLE\n" | |
print line.split(",")[0] + "\n" unless line == "ROUTING TABLE\n" | |
else | |
people = 1 if line == "Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since\n" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment