tmuxme 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/TODO.md +7 -0
  3. data/bin/tmuxme +22 -0
  4. data/lib/tmuxme/version.rb +1 -1
  5. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d66f4cedbba19c4a4b0942af1a45749f41437613
4
- data.tar.gz: f0ab574d9600d278e0676a235f4c8a2c5528e837
3
+ metadata.gz: 05459a1c8b370b7e1745127533ca9914ee71c236
4
+ data.tar.gz: a75da8123b708aefa6ee7b315916285c4b999182
5
5
  SHA512:
6
- metadata.gz: 0905c1851374b473116ae596ddf4471842298456e6175db639d68bec1a702c5110f49d27d06a22152787b6f44f431a23c9f5063293de85195e440f696af4d2eb
7
- data.tar.gz: 64ff7056b16657534275e83973b264a080bc454ad7e1d272fb9fd92a55c25c87383d947c5b8af72ea48dd35c37589397feb568f5cceb1fa4a7a4445810a92e79
6
+ metadata.gz: 8c23f7b92e25440f310fa042a37c60a33d4ed0fd4f473c91cff9eb1eb63f9bf89cad4ee80f9660f168210ca0a2b6bfd0e62b5c0ec7423411476d340190f092ab
7
+ data.tar.gz: 8540192d0573b77822b71b1170c531bee7b1a03580238455e4e05dbd731aa95834cc0c371c46d73f8fb94abbbf4bef94265a6031db840bcc7c82e1033cec3c41
data/TODO.md ADDED
@@ -0,0 +1,7 @@
1
+ # Things that need doing
2
+
3
+ - Add logic at the top of the client that verifies that Remote Login is
4
+ enabled and that the running user is listed in the access list. If it is not
5
+ enabled then prompt the user to ask them if they want to enable it. If they
6
+ don't then exit tmuxme. If they do enable it then make sure they are in the
7
+ access list. If they aren't add them to the access list.
data/bin/tmuxme CHANGED
@@ -22,6 +22,16 @@ if ARGV.length < 1
22
22
  exit
23
23
  end
24
24
 
25
+ # Check if remote login is enabled
26
+ `netstat -an | grep "*\.22" | grep tcp4 | grep LISTEN`
27
+ if $? != 0
28
+ # didn't find it listening on port 22
29
+ puts "Error: Remote Login is not enabled"
30
+ puts "tmuxme requires Remote Login to be enabled for this user."
31
+ puts "Please enable Remote Login in System Preferences -> Sharing -> Remote Login and try again."
32
+ exit
33
+ end
34
+
25
35
  invitees = ARGV.dup
26
36
  pairers = []
27
37
 
@@ -29,6 +39,18 @@ remote_port = nil
29
39
  remote_port_lock = Mutex.new
30
40
 
31
41
  begin
42
+
43
+ # Make sure the ~/.ssh directory exists
44
+ if !File.directory?("#{ENV['HOME']}/.ssh")
45
+ FileUtils.mkdir_p("#{ENV['HOME']}/.ssh", :mode => 0700)
46
+ end
47
+
48
+ # Make sure the ~/.ssh/authorized_keys file exists
49
+ if !File.exists?("#{ENV['HOME']}/.ssh/authorized_keys")
50
+ FileUtils.touch("#{ENV['HOME']}/.ssh/authorized_keys")
51
+ FileUtils.chmod(0600, "#{ENV['HOME']}/.ssh/authorized_keys")
52
+ end
53
+
32
54
  # back up users authorized_keys file
33
55
  if !File.exists?("#{ENV['HOME']}/.ssh/authorized_keys.tmuxme.original")
34
56
  puts "- Backing up ~/.ssh/authorized_keys to ~/.ssh/authorized_keys.tmuxme.original to store it the first time tmuxme was run"
@@ -1,3 +1,3 @@
1
1
  module Tmuxme
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tmuxme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew De Ponte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-30 00:00:00.000000000 Z
11
+ date: 2013-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -81,6 +81,7 @@ files:
81
81
  - LICENSE.txt
82
82
  - README.md
83
83
  - Rakefile
84
+ - TODO.md
84
85
  - bin/tmuxme
85
86
  - lib/tmuxme.rb
86
87
  - lib/tmuxme/version.rb