Mise à jour de 'Run.sh'
This commit is contained in:
21
Run.sh
21
Run.sh
@@ -3,6 +3,8 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
OUTPUT_DIR="$2"
|
||||
CFG_FILE="$3"
|
||||
DEFAULT_CFG_FILE=NIUT.ini
|
||||
DEFAULT_INSTALL_CFG_FILE=UnrealTournament.ini
|
||||
|
||||
function add_iniKeyEx() {
|
||||
crudini --set $OUTPUT_DIR/System/$1 $2 __$3 $4
|
||||
# Warning: ugly hack with sed to allow multiple key instances + to remove space around '='
|
||||
@@ -131,6 +133,21 @@ function check_cfg_file_gen() {
|
||||
exit 9999 # die with error code 9999
|
||||
fi
|
||||
}
|
||||
function check_cfg_file_gen2() {
|
||||
if [ -z ${CFG_FILE} ]
|
||||
then
|
||||
echo "CFG_FILE is unset, setting it to $DEFAULT_INSTALL_CFG_FILE"
|
||||
CFG_FILE=$DEFAULT_INSTALL_CFG_FILE
|
||||
else
|
||||
echo "CFG_FILE is set to '$CFG_FILE'"
|
||||
fi
|
||||
if [ ! -f $OUTPUT_DIR/System/$CFG_FILE ]
|
||||
then
|
||||
echo "$OUTPUT_DIR/System/$CFG_FILE does not exist"
|
||||
show_help
|
||||
exit 9999 # die with error code 9999
|
||||
fi
|
||||
}
|
||||
function check_game_dir() {
|
||||
### Check if a directory does not exist ###
|
||||
if [ -z $OUTPUT_DIR ]
|
||||
@@ -151,7 +168,7 @@ case "$1" in
|
||||
;;
|
||||
'enable')
|
||||
check_game_dir "$@"
|
||||
check_cfg_file_gen "$@"
|
||||
check_cfg_file_gen2 "$@"
|
||||
disable "$@"
|
||||
enable "$@"
|
||||
;;
|
||||
@@ -162,7 +179,7 @@ case "$1" in
|
||||
;;
|
||||
'disable')
|
||||
check_game_dir "$@"
|
||||
check_cfg_file_gen "$@"
|
||||
check_cfg_file_gen2 "$@"
|
||||
disable "$@"
|
||||
;;
|
||||
*)
|
||||
|
||||
Reference in New Issue
Block a user