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
require "net/http" | |
require "uri" | |
require "json" | |
def print_router_routes(name, ip) | |
uri = URI.parse("http://#{ip}:8080/routes") | |
http = Net::HTTP.new(uri.host, uri.port) | |
request = Net::HTTP::Get.new(uri.request_uri) | |
request.basic_auth("router_user", "router_password") |
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
#!/usr/bin/env ruby | |
require 'yaml' | |
filename = ARGV[0] | |
path = ARGV[1] | |
def get(hash, path_array) | |
unless path_array.empty? | |
get(hash[path_array[0]], path_array[1..-1]) |
NewerOlder