freydis 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +17 -0
- data/README.md +40 -33
- data/bin/freydis +6 -49
- data/freydis.gemspec +35 -23
- data/lib/freydis/config.rb +44 -0
- data/lib/freydis/cryptsetup.rb +40 -43
- data/lib/freydis/disk.rb +21 -64
- data/lib/freydis/disk_luks.rb +33 -0
- data/lib/freydis/error.rb +9 -0
- data/lib/freydis/guard.rb +48 -4
- data/lib/freydis/options.rb +57 -29
- data/lib/freydis/rsync.rb +34 -40
- data/lib/freydis/secrets/archive.rb +63 -0
- data/lib/freydis/secrets/gpg.rb +63 -0
- data/lib/freydis/secrets.rb +29 -0
- data/lib/freydis/version.rb +3 -1
- data/lib/freydis.rb +24 -3
- data/lib/mods/exec.rb +27 -0
- data/lib/mods/msg.rb +16 -0
- data.tar.gz.sig +0 -0
- metadata +47 -15
- metadata.gz.sig +0 -0
- data/Rakefile +0 -21
- data/lib/freydis/data.rb +0 -39
- data/lib/freydis/init.rb +0 -78
data/lib/freydis/init.rb
DELETED
@@ -1,78 +0,0 @@
|
|
1
|
-
# lib/init.rb
|
2
|
-
|
3
|
-
module Freydis
|
4
|
-
module Init
|
5
|
-
|
6
|
-
puts "===> Starting Init"
|
7
|
-
|
8
|
-
def self.run(options)
|
9
|
-
loop do
|
10
|
-
puts %q{Please select an option:
|
11
|
-
|
12
|
-
1. Choose a disk (plug on)
|
13
|
-
2. Add more paths
|
14
|
-
3. Reset paths
|
15
|
-
4. Show options
|
16
|
-
5. Save & Quit}
|
17
|
-
|
18
|
-
case gets.chomp
|
19
|
-
when '1'
|
20
|
-
select_disk(options)
|
21
|
-
when '2'
|
22
|
-
puts "Add a path..."
|
23
|
-
add_path(options)
|
24
|
-
when '3'
|
25
|
-
puts "Reseting paths..."
|
26
|
-
options[:paths] = []
|
27
|
-
when '4'
|
28
|
-
show_options(options)
|
29
|
-
else
|
30
|
-
puts "Quit."
|
31
|
-
return
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
private
|
37
|
-
|
38
|
-
def self.select_disk(options)
|
39
|
-
disks_list = Dir.glob("/dev/sd?")
|
40
|
-
puts "Available disks: (only type sdX)"
|
41
|
-
disks_list.each { |d|
|
42
|
-
your_disk = Freydis::Disk.new(d)
|
43
|
-
puts "+ " + your_disk.complete_info
|
44
|
-
}
|
45
|
-
print "> "
|
46
|
-
answer = $stdin.gets
|
47
|
-
disk = answer.chomp
|
48
|
-
if File.exist? "/dev/#{disk}"
|
49
|
-
options[:disk] = disk
|
50
|
-
puts "Disk #{disk} added."
|
51
|
-
else
|
52
|
-
puts "No disk #{disk} found."
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
def self.add_path(options)
|
57
|
-
print "> "
|
58
|
-
answer = $stdin.gets
|
59
|
-
new_path = answer.chomp if answer
|
60
|
-
if Dir.exists? new_path
|
61
|
-
options[:paths] << new_path
|
62
|
-
puts "Path '#{new_path}' added"
|
63
|
-
display_path(options)
|
64
|
-
else
|
65
|
-
puts "#{new_path} no found"
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
def self.display_path(options)
|
70
|
-
puts "Current paths:"
|
71
|
-
options[:paths].each { |p| puts "+ #{p}" }
|
72
|
-
end
|
73
|
-
|
74
|
-
def self.show_options(options)
|
75
|
-
puts options
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|