sshfs 0.0.2
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 +7 -0
- data/bin/sshfs +70 -0
- metadata +45 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e799c8fd518e1820f906fc6665ead155e60dafaa
|
4
|
+
data.tar.gz: 49f251bf3f95f52984e8185a8fff5bf50c562c58
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 158170b75f461c2280039b1e950b28013c9185a2a039cb25d099377c1f10b63fad3e90e0c9d897cfdf324264a76d99bb03b02363623cabd62ae0c1a05739e535
|
7
|
+
data.tar.gz: 503e4298ef2c870b488e326a9121d14d769378cf8f378284e84d64df86d56ff8c15ab58556c5cc0a418221c16a4b0306400f4a7a39ce0fea526b155c88a7bfee
|
data/bin/sshfs
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
require 'yaml'
|
3
|
+
require 'optparse'
|
4
|
+
require 'fileutils'
|
5
|
+
|
6
|
+
SSHFS = ENV['HOME']+"/.sshfs/"
|
7
|
+
KEYFOLDER = ENV['HOME']+"/.ssh/"
|
8
|
+
COMMAND = ARGV[0]
|
9
|
+
NAME = ARGV[1]
|
10
|
+
EDITOR = "vim"
|
11
|
+
SSH = "ssh"
|
12
|
+
|
13
|
+
defaults = {
|
14
|
+
"server" => "localhost",
|
15
|
+
"username" => ENV['USER'],
|
16
|
+
"port" => 22,
|
17
|
+
"parameters" => '-X'
|
18
|
+
}
|
19
|
+
|
20
|
+
commands = {
|
21
|
+
"start" => "Start connection",
|
22
|
+
"new" => "Create connection",
|
23
|
+
"delete" => "Delete connection",
|
24
|
+
"edit" => "Edit Connection",
|
25
|
+
"list" => "List Connection names",
|
26
|
+
"pubkey" => "Show public key",
|
27
|
+
"privkey" => "Show private key",
|
28
|
+
"keygen" => "SSH key generate",
|
29
|
+
"copykey" => "Copy ssh key"
|
30
|
+
}
|
31
|
+
|
32
|
+
case COMMAND
|
33
|
+
when "start"
|
34
|
+
config = YAML.load(File.open("#{SSHFS}#{NAME}.yml"))
|
35
|
+
system("#{SSH} #{config["parameters"]} -p #{config["port"]} #{config["username"]}@#{config["server"]}")
|
36
|
+
when "new"
|
37
|
+
FileUtils.mkdir_p(SSHFS)
|
38
|
+
File.open("#{SSHFS}#{NAME}.yml","w") do |f|
|
39
|
+
f.write defaults.to_yaml
|
40
|
+
end
|
41
|
+
system("#{EDITOR} #{SSHFS}#{NAME}.yml")
|
42
|
+
when "delete"
|
43
|
+
FileUtils.rm("#{SSHFS}#{NAME}.yml")
|
44
|
+
when "edit"
|
45
|
+
FileUtils.mkdir_p(SSHFS)
|
46
|
+
system("#{EDITOR} #{SSHFS}#{NAME}.yml")
|
47
|
+
when "list"
|
48
|
+
Dir.entries(SSHFS).select do |entry|
|
49
|
+
if entry != ".." && entry != "."
|
50
|
+
entry = entry[0,(entry.length - 4)]
|
51
|
+
if entry.length > 0
|
52
|
+
puts entry
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
when "pubkey"
|
57
|
+
system("cat #{KEYFOLDER}#{NAME}.pub")
|
58
|
+
when "privkey"
|
59
|
+
system("cat #{KEYFOLDER}#{NAME}")
|
60
|
+
when "keygen"
|
61
|
+
system("ssh-keygen")
|
62
|
+
when "copykey"
|
63
|
+
config = YAML.load(File.open("#{SSHFS}#{NAME}.yml"))
|
64
|
+
system("ssh-copy-id -p #{config["port"]} #{config["username"]}@#{config["server"]}")
|
65
|
+
else
|
66
|
+
puts "Ussage: #{File.basename(__FILE__,File.extname(__FILE__))} [commands]"
|
67
|
+
commands.each do |command,desc|
|
68
|
+
puts "#{command}\t #{desc}"
|
69
|
+
end
|
70
|
+
end
|
metadata
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sshfs
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Oytun OZDEMIR
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-10-28 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Simple ssh connections and configurations script
|
14
|
+
email: oytunozdemir@gmail.com
|
15
|
+
executables:
|
16
|
+
- sshfs
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- bin/sshfs
|
21
|
+
homepage: https://github.com/oytunistrator/sshfs
|
22
|
+
licenses:
|
23
|
+
- Unlicense
|
24
|
+
metadata: {}
|
25
|
+
post_install_message:
|
26
|
+
rdoc_options: []
|
27
|
+
require_paths:
|
28
|
+
- lib
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - '>='
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
requirements: []
|
40
|
+
rubyforge_project:
|
41
|
+
rubygems_version: 2.0.14.1
|
42
|
+
signing_key:
|
43
|
+
specification_version: 4
|
44
|
+
summary: SSHFS!
|
45
|
+
test_files: []
|