Statistics
| Branch: | Tag: | Revision:

one / share / hooks / firewall @ ced96c87

History | View | Annotate | Download (286 Bytes)

1
#!/usr/bin/env ruby
2

    
3

    
4
$: << File.dirname(__FILE__)
5

    
6
require 'base64'
7
require 'OpenNebulaVLAN'
8

    
9
action      = ARGV[0]
10
template    = ARGV[1]
11

    
12
vm_xml =  Base64::decode64(template)
13

    
14
fw = OpenNebulaFirewall.new(vm_xml)
15

    
16
case action
17
when "on"
18
    fw.activate
19
when "off"
20
    fw.deactivate
21
end