Files
new_install/main/setup
lizhi-rocky 0c425d031d 1. unify install.xml location
2. in ri_data.py, fix an error on Raid instance construction
3. in ri_func_dep.py, use common function ri_data.Group.get_install_pkgs()
4. in ri_install.py, add logic to config install.xml location
5. rename test.py to ri_main.py
6. in ri_main.py, add logic to set config.xml location
7. in ri_main.py, modify the way to get parameters.
2010-10-18 17:34:55 +08:00

89 lines
2.4 KiB
Bash
Executable File

#!/bin/bash -
#
#===================================================================================
#
# Copyright Beijing Linx Technology Co., Ltd. 2010年09月13日
#
# Filename: setup
#
# USAGE: ./setup
#
# Description: Setup startup script
#
# Version: 0.1
# Created: 2010年09月13日
#
# Author: Hu Gang
#
# ChangeLog: 1. 2010年09月13日 Create.
#
#===================================================================================
#
#===================================================================================
#Set variables
#===================================================================================
workdir='/usr/lib/new_install/interface'
exec_file='xinitrc_setup'
work_write_dir='/var/install'
#===================================================================================
#Performance function
#===================================================================================
usage(){
echo "usage: $0 [-s|--style style] [-l|--language language][-n|--noXserver][-h|--help]"
echo "style [text|graph]"
echo "language [english|chinese]"
echo "default Xserver start"
}
config_execfile(){
echo "#!/bin/bash" > ${work_write_dir}/${exec_file}
echo "cd ${workdir}" >> ${work_write_dir}/${exec_file}
if [ -f ${work_write_dir}/install.xml ]; then
echo "python check_oldconf.py -l $1 " >> ${work_write_dir}/${exec_file}
fi
echo "python ri_main.py -l $1" >> ${work_write_dir}/${exec_file}
}
main(){
local style='graph'
local language='english'
local xstart='yes'
tmp=$(getopt -o s:l:nh --long style:,language:,noXserver,help -- "$@")
eval set -- "$tmp"
mkdir -p $work_write_dir
while true;do
case "$1" in
'-s'|'--style') type="$2" ;shift 2;;
'-l'|'--language') language="$2" ;shift 2;;
'-n'|'--noXserver') xstart='no' ;shift ;;
'-h'|'--help') usage ; exit 0 ;;
'--') shift; break ;;
*) usage ; exit 1 ;;
esac
done
if [ $style = 'graph' ]; then
config_execfile "$language"
else
:
# text install
fi
if [ $xstart = 'yes' ]; then
X -configure
startx ${work_write_dir}/${exec_file} -- -config ~/xorg.conf.new
else
bash ${work_write_dir}/${exec_file}
fi
}
#===================================================================================
#Execution
#===================================================================================
main "$@"