output = File.open("/home/debian/avg/tunnels.txt", "r") tunnel = `curl -s -k 'https://username:password@192.168.10.10/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