Statistics
| Revision:

root / hci / trunk / eneraptor-web-app / grails-app / conf / BootStrap.groovy @ 11

History | View | Annotate | Download (746 Bytes)

1
import com.eneraptor.hci.InternalConfig
2

    
3
class BootStrap {
4

    
5
    def init = { servletContext ->
6
                
7
                // First-run installation
8
                
9
                if(!InternalConfig.count()) {
10
                        
11
                        System.out.println("[eneraptor-hci] Running for the first time. Installing...");
12
                        
13
                        // HCI configuration
14
                        new InternalConfig(configId:'hci-version', configVal:'0.10.12.26').save()
15
                        new InternalConfig(configId:'super-admin', configVal:'admin'     ).save()
16
                        new InternalConfig(configId:'super-pass' , configVal:'pass'      ).save()
17
                        
18
                        // HCI <--> Logic Configuration
19
                        new InternalConfig(configId:'logic-ip'   , configVal:'127.0.0.1' ).save()
20
                        new InternalConfig(configId:'logic-port' , configVal:'80'        ).save()
21
                        
22
                }
23
                
24
    }
25
    def destroy = {
26
    }
27
}