annoying-wifi 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/annoying-wifi.gemspec +1 -1
  2. data/bin/annoying-wifi +14 -13
  3. metadata +1 -1
@@ -11,7 +11,7 @@ Gem::Specification.new do |gem|
11
11
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
12
12
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
13
13
  gem.name = "annoying-wifi"
14
- gem.version = "0.0.2"
14
+ gem.version = "0.0.3"
15
15
 
16
16
  gem.add_dependency "rake"
17
17
  gem.add_dependency "thor"
@@ -5,24 +5,25 @@ require "thor"
5
5
  require "yaml"
6
6
 
7
7
  class AnnoyingWifi < Thor
8
- desc "login", "Logs you in to the wifi"
8
+ desc "login", "Logs you in to the wifi. `USERNAME=takeoff_XXX PASSWORD=XXX annoying-wifi login`"
9
9
  def login
10
- while true
10
+ while true
11
11
  username = ENV.fetch('USERNAME') { raise "need USERNAME" }
12
12
  password = ENV.fetch('PASSWORD') { raise "need PASSWORD" }
13
- say "Attempting login with #{username} / #{"*"*password.length}"
14
- req = Curl::Easy.http_post("https://controller.mobile.lan/portal_api.php", "action=authenticate&login=#{username}&password=#{password}")
13
+
14
+ say "Attempting login with #{username} / #{"*"*password.length}"
15
+ req = Curl::Easy.http_post("https://controller.mobile.lan/portal_api.php", "action=authenticate&login=#{username}&password=#{password}")
15
16
 
16
17
  puts req.body_str
17
- if req.body_str =~ /errorMessage/
18
- puts "Wrong user name/password"
19
- elsif req.body_str =~ /expired/
20
- puts "Looks like your username/password expired"
21
- else
22
- say "Hooray, you are now logged in!"
23
- break
24
- end
25
- end
18
+ if req.body_str =~ /error/
19
+ puts "Wrong user name/password"
20
+ elsif req.body_str =~ /expired/
21
+ puts "Looks like your username/password expired"
22
+ else
23
+ say "Hooray, you are now logged in!"
24
+ break
25
+ end
26
+ end
26
27
  end
27
28
 
28
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: annoying-wifi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: