Revision 3 hci/trunk/eneraptor-web-app/grails-app/conf/BootStrap.groovy
BootStrap.groovy | ||
---|---|---|
1 |
import com.eneraptor.hci.InternalConfig |
|
2 |
|
|
1 | 3 |
class BootStrap { |
2 | 4 |
|
3 | 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 |
|
|
4 | 24 |
} |
5 | 25 |
def destroy = { |
6 | 26 |
} |
Also available in: Unified diff