#!/usr/bin/ruby
require 'open-uri'
output = File.readlines("/home/debian/avg/tunnels.txt")
tunnel = `curl -s -k 'https://root:[email protected]/nph-vpn.cgi?name="#{output}"&cmd=status'\
`
if tunnel.include? "active"
puts "The tunnel is ACTIVE"
elsif
tunnel.include? "down"
puts "The tunnels is DOWN"
elsif
tunnel.include? "unknown"
puts "The Status of the tunnel is currently UNKNOWN"
else
puts "The Tunnel has reported the status of #{tunnel}"
end