Last active
December 27, 2015 03:39
-
-
Save seanchas116/7260799 to your computer and use it in GitHub Desktop.
titech-pubnetに接続中の場合プロキシ環境変数を設定するだけのスクリプト(Macのみ) シェルでeval `ruby pubnet-proxy.rb`する
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
def get_ssid | |
airport = '/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I' | |
`#{airport}`.split("\n").each do |line| | |
words = line.split | |
if words[0] == 'SSID:' | |
return words[1] | |
end | |
end | |
'' | |
end | |
if get_ssid == 'titech-pubnet' | |
puts 'echo "titech-pubnet proxy configured";' | |
puts 'export http_proxy=131.112.125.238:3128;' | |
puts 'export ALL_PROXY=$http_proxy;' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment