wifi-watch 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +16 -2
- data/bin/wifi-watch +14 -5
- data/wifi-watch.gemspec +1 -1
- metadata +2 -5
- data/test/results/dns-down.out +0 -11
- data/test/results/fail-mode.out +0 -6
- data/test/results/wifi-login.out +0 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cfaa11569827201e5cfdbd4c2a12a6ae39821200
|
|
4
|
+
data.tar.gz: 2008abb7d60341ac78ae9795561dace06a88328b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 647b3eda4408818db7cab2d11c50b414d9ba51310a2e4b006756f659e7bc92e5c7250044d4d7266b06366c7d289b326477fe3affae33be0fa4977e05de962f61
|
|
7
|
+
data.tar.gz: 95ae3066b5f008fa73aabfe372f729ca7ad625c6bdda2869fdae1fc9da4990546f44b11e1eeaaa69512b693c5ce48789a1ed397610f23cdb0c8b6847970ce538
|
data/.gitignore
CHANGED
data/README.md
CHANGED
|
@@ -33,15 +33,29 @@ on a moment to moment basis.
|
|
|
33
33
|
|
|
34
34
|
### Installation
|
|
35
35
|
|
|
36
|
+
You can install the gem from rubygems.org
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
gem install wifi-watch
|
|
40
|
+
```
|
|
41
|
+
|
|
36
42
|
wifi-watch is a stand alone ruby script which will run with
|
|
37
|
-
any ruby version and has no dependencies.
|
|
38
|
-
and copy wifi-watch into your path.
|
|
43
|
+
any ruby version and has no dependencies. You can git clone
|
|
44
|
+
the repository and copy wifi-watch into your path.
|
|
39
45
|
|
|
40
46
|
```
|
|
41
47
|
git clone https://github.com/jgorman/wifi-watch.git
|
|
42
48
|
sudo cp wifi-watch/bin/wifi-watch /usr/local/bin
|
|
43
49
|
```
|
|
44
50
|
|
|
51
|
+
You can use curl or wget to download the script.
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
curl https://raw.githubusercontent.com/jgorman/wifi-watch/master/bin/wifi-watch >wifi-watch
|
|
55
|
+
chmod +x wifi-watch
|
|
56
|
+
sudo mv wifi-watch /usr/local/bin
|
|
57
|
+
```
|
|
58
|
+
|
|
45
59
|
### Usage: wifi-watch [options]
|
|
46
60
|
|
|
47
61
|
```
|
data/bin/wifi-watch
CHANGED
|
@@ -9,7 +9,7 @@ class WifiWatch
|
|
|
9
9
|
Default_host = "ns.google.com" # Ping target host.
|
|
10
10
|
Default_count = 600 # Accounting period in seconds.
|
|
11
11
|
Program = "wifi-watch"
|
|
12
|
-
Version = "1.0.
|
|
12
|
+
Version = "1.0.1"
|
|
13
13
|
|
|
14
14
|
def run
|
|
15
15
|
@shown_header = false # Have we shown the column headers yet?
|
|
@@ -86,6 +86,7 @@ class WifiWatch
|
|
|
86
86
|
|
|
87
87
|
opt.on("-c", "--count seconds", Integer,
|
|
88
88
|
"Accounting period [#{options.count}].") do |count|
|
|
89
|
+
raise "--count must be positive" unless count > 0
|
|
89
90
|
options.count = count
|
|
90
91
|
end
|
|
91
92
|
|
|
@@ -164,6 +165,8 @@ class WifiWatch
|
|
|
164
165
|
last_notified = now
|
|
165
166
|
end
|
|
166
167
|
sleep 0.2 # Be nice to the cpu.
|
|
168
|
+
rescue
|
|
169
|
+
break # Some systems throw an error at eof.
|
|
167
170
|
end
|
|
168
171
|
end
|
|
169
172
|
if last_notified > waiting_start
|
|
@@ -171,7 +174,13 @@ class WifiWatch
|
|
|
171
174
|
end
|
|
172
175
|
|
|
173
176
|
# Process each line of ping output.
|
|
174
|
-
|
|
177
|
+
while true
|
|
178
|
+
begin
|
|
179
|
+
line = stdin.gets
|
|
180
|
+
rescue
|
|
181
|
+
break # Some systems throw an error at eof.
|
|
182
|
+
end
|
|
183
|
+
break unless line
|
|
175
184
|
|
|
176
185
|
line.chomp!
|
|
177
186
|
if first_byte
|
|
@@ -339,11 +348,11 @@ class WifiWatch
|
|
|
339
348
|
|
|
340
349
|
# Is the target count hour aligned?
|
|
341
350
|
minutes = count / 60
|
|
342
|
-
if 60 % minutes != 0
|
|
343
|
-
return count # Not hour aligned
|
|
351
|
+
if 60 % minutes != 0
|
|
352
|
+
return count # Not hour aligned.
|
|
344
353
|
end
|
|
345
354
|
|
|
346
|
-
# See if we are already
|
|
355
|
+
# See if we are already suitably aligned right now.
|
|
347
356
|
now = Time.now
|
|
348
357
|
mm = now.min
|
|
349
358
|
ss = now.sec
|
data/wifi-watch.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: wifi-watch
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- John Gorman
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-03-
|
|
11
|
+
date: 2018-03-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Run wifi-watch in a terminal so that you can easily check your network
|
|
14
14
|
quality at this moment and how it has been holding up since you began recording
|
|
@@ -34,9 +34,6 @@ files:
|
|
|
34
34
|
- test/ping_logs/dns-slow.log
|
|
35
35
|
- test/ping_logs/fail-mode.log
|
|
36
36
|
- test/ping_logs/wifi-login.log
|
|
37
|
-
- test/results/dns-down.out
|
|
38
|
-
- test/results/fail-mode.out
|
|
39
|
-
- test/results/wifi-login.out
|
|
40
37
|
- test/run_tests
|
|
41
38
|
- wifi-watch.gemspec
|
|
42
39
|
homepage: https://github.com/jgorman/wifi-watch
|
data/test/results/dns-down.out
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
09:47:38 ping: cannot resolve ns.google.com: Unknown host
|
|
2
|
-
PING ns.google.com (216.239.32.10): 56 data bytes
|
|
3
|
-
|
|
4
|
-
Time Ping Run Mode Failed Round Trip
|
|
5
|
-
----- ---- ---- ---- ------ ----------
|
|
6
|
-
09:47 10 10 good 0.0% 54.45 ms
|
|
7
|
-
09:47 10 5 good 50.0% 76.66 ms
|
|
8
|
-
09:48:06 ping: cannot resolve ns.google.com: Unknown host
|
|
9
|
-
09:48 10 10 good 0.0% 72.06 ms
|
|
10
|
-
09:48 10 3 good 70.0% 82.17 ms
|
|
11
|
-
09:48:34 ping: cannot resolve ns.google.com: Unknown host
|
data/test/results/fail-mode.out
DELETED
data/test/results/wifi-login.out
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
PING ns.google.com (216.239.32.10): 56 data bytes
|
|
2
|
-
|
|
3
|
-
Time Ping Run Mode Failed Round Trip
|
|
4
|
-
----- ---- ---- ---- ------ ----------
|
|
5
|
-
10:45 5 1 fail 20.0% 68.06 ms
|
|
6
|
-
10:45:43 92 bytes from 10.128.128.128: Communication prohibited by filter
|
|
7
|
-
10:45 11 3 good 36.4% 61.58 ms
|