sheepsafe 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/lib/sheepsafe.rb +1 -1
- data/lib/sheepsafe/controller.rb +17 -2
- data/sheepsafe.gemspec +2 -2
- metadata +4 -4
data/History.txt
CHANGED
data/lib/sheepsafe.rb
CHANGED
data/lib/sheepsafe/controller.rb
CHANGED
@@ -19,6 +19,11 @@ module Sheepsafe
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def run
|
22
|
+
if ARGV.first == 'proxy' # 'sheepsafe proxy up/down'
|
23
|
+
bring_socks_proxy ARGV[1]
|
24
|
+
return
|
25
|
+
end
|
26
|
+
|
22
27
|
log("Sheepsafe starting")
|
23
28
|
if network_up?
|
24
29
|
if network_changed?
|
@@ -58,8 +63,18 @@ module Sheepsafe
|
|
58
63
|
|
59
64
|
def bring_socks_proxy(direction)
|
60
65
|
Daemons.run_proc '.sheepsafe.proxy', :ARGV => [direction == 'up' ? 'start' : 'stop'], :dir_mode => :normal, :dir => ENV['HOME'] do
|
61
|
-
|
62
|
-
|
66
|
+
pid = nil
|
67
|
+
trap("TERM") do
|
68
|
+
Process.kill("TERM", pid)
|
69
|
+
exit 0
|
70
|
+
end
|
71
|
+
loop do
|
72
|
+
pid = fork do
|
73
|
+
exec("ssh -ND #{@config.socks_port} #{@config.ssh_host}")
|
74
|
+
end
|
75
|
+
Process.waitpid(pid, 0)
|
76
|
+
sleep 1
|
77
|
+
end
|
63
78
|
end
|
64
79
|
end
|
65
80
|
|
data/sheepsafe.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sheepsafe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 2
|
10
|
+
version: 0.2.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Nick Sieger
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-11-02 00:00:00 -05:00
|
19
19
|
default_executable: sheepsafe
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|