-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmaxconf.gen.py
More file actions
52 lines (38 loc) · 1.33 KB
/
maxconf.gen.py
File metadata and controls
52 lines (38 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/python
import sys, getopt, uuid, time
try:
opts, args = getopt.getopt(sys.argv[1:], '', ['install=','model='])
opts = dict(opts)
except getopt.GetoptError, err:
print >> sys.stderr, 'Could not parse command line options.'
sys.exit(1)
if '--install' not in opts:
print >> sys.stderr, 'Install parameter must be defined.'
sys.exit(1)
if '--model' not in opts:
opts['--model'] = 'Robot'
print >> sys.stdout, '''
# Max kernel configuration file
# Created and maintained 2012 by Andrew Klofas <andrew@maxkernel.com>
# parsed by libconfuse
id = "%(id)s"
setpath("%(install)s:%(install)s/modules")
installed = %(time)d
model = "%(model)s"
loadmodule("netui.mo") # creates a http server to show innards of kernel
loadmodule("console.mo") # provide kernel console (through unix sockets)
loadmodule("discovery.mo") # provide auto discovery mechanism
loadmodule("service.mo") # allow autodetection of services
# uncomment if you want to allow syscalls through the network
#config("console", "enable_network", 1)
# comment out if you want to remain hidden on the network
config("discovery", "enable_discovery", 1)
# now execute a stage 2 script
execdirectory("stitcher")
# EOF
''' % {
'id' : str(uuid.uuid1()),
'install' : opts['--install'],
'time' : time.time(),
'model' : opts['--model'],
},