mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-11 05:17:41 +03:00
22 lines
286 B
Ruby
Executable File
22 lines
286 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
|
|
|
|
$: << File.dirname(__FILE__)
|
|
|
|
require 'base64'
|
|
require 'OpenNebulaVLAN'
|
|
|
|
action = ARGV[0]
|
|
template = ARGV[1]
|
|
|
|
vm_xml = Base64::decode64(template)
|
|
|
|
fw = OpenNebulaFirewall.new(vm_xml)
|
|
|
|
case action
|
|
when "on"
|
|
fw.activate
|
|
when "off"
|
|
fw.deactivate
|
|
end
|