Add script for seting up media center
This commit is contained in:
parent
8789922ba6
commit
c08110ae38
6 changed files with 161 additions and 0 deletions
34
bin/vm
34
bin/vm
|
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
require 'optparse'
|
||||
require 'ostruct'
|
||||
require 'virtual-machine'
|
||||
|
||||
# vm setup debian --arch "<host:arch64>" --name "<image_name: debian>"
|
||||
|
||||
options = OpenStruct.new
|
||||
subcommand = ARGV.shift&.to_sym
|
||||
options.parameter = ARGV[0] && ARGV[0] !~ /^-/ ? ARGV.shift : nil
|
||||
|
||||
OptionParser.new do |opt|
|
||||
opt.on('--arch ARCH', 'Architecture arm64 or x86_64') do |arch|
|
||||
options.arch = arch
|
||||
end
|
||||
|
||||
opt.on('--name NAME', 'Virtaul Machine name') do |arch|
|
||||
options.arch = arch
|
||||
end
|
||||
|
||||
end.parse!
|
||||
|
||||
|
||||
case subcommand
|
||||
when :create
|
||||
puts "Creating image...."
|
||||
|
||||
when :setup
|
||||
options[:distro] = subcommand
|
||||
VirtualMachine.setup(options)
|
||||
else
|
||||
puts "Error not found #{options.type}"
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue