修改ubuntu下的hosts 你懂的

2015-08-18 0 776
修改ubuntu下的hosts  你懂的
#!/usr/bin/ruby
#coding=utf-8
require 'open-uri'

url= "http ://raw.github usercontent.com/ vokins/simpleu/master/hosts"

begin
  open("/etc/hosts","w") do |x|
    x.write open(url).read
  end
rescue Errno::EACCES
  puts "Need root? "
  exec "sudo ruby " + $0 + ARGV.join(' ')
end
puts "Write hosts success!"

遇见资源网 ruby 修改ubuntu下的hosts 你懂的 http://www.ox520.com/16455.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务