Files
new_install/operation/finish_install/98state_grid_custom.py
Peng Zhihui bee7e14e77 Correct getting instmode
modified:   interface/ri_inst_cli.py
	modified:   operation/finish_install/98state_grid_custom.py
2014-04-28 09:27:16 +08:00

33 lines
777 B
Python
Executable File

#!/usr/bin/env python
# run finish_install scripts
#
import os,sys,re
sys.path.append('../interface')
import ri_data
# get data from install.xml
ri_data.init_from_xml()
username = ri_data.StateGrid.username
homedir = ri_data.StateGrid.home_dir
shell = ri_data.StateGrid.shell
# run state grid custom scripts
#f = open('/proc/cmdline', 'r')
#cmdline = f.readline().strip()
#f.close()
#for i in cmdline.split(' '):
# if re.match('instmode=',i):
# instmode = i.split('=')[1]
# break
try:
instmode = os.environ["instmode"]
except:
instmode = 'Text'
if instmode == 'StateGrid':
os.system("cp -r /usr/lib/StateGrid /mnt/opt/")
os.system("chroot /mnt /opt/StateGrid/setup.sh %s %s %s" %(username, homedir, shell))
os.system("rm -rf /mnt/opt/StateGrid")