Skip to content

Instantly share code, notes, and snippets.

@seanchas116
Last active December 27, 2015 03:39
Show Gist options
  • Save seanchas116/7260799 to your computer and use it in GitHub Desktop.
Save seanchas116/7260799 to your computer and use it in GitHub Desktop.
titech-pubnetに接続中の場合プロキシ環境変数を設定するだけのスクリプト(Macのみ) シェルでeval `ruby pubnet-proxy.rb`する
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