diff --git a/src/func/config_load b/src/func/config_build similarity index 69% rename from src/func/config_load rename to src/func/config_build index 8622593..abe3721 100644 --- a/src/func/config_load +++ b/src/func/config_build @@ -2,14 +2,25 @@ #remaster lib [ -d "" ] || { echo "LIBDIR not exist"; exit 1; } -#config_load config -function config_load() { - config="$1" +#config_build jobfile configenv +function config_build() { + config_file="$1" + config_env="$2" echo "### S e t t i n g s ###" + [ -f "$config_file" ] || { + echo "Config: wrong path for jobfile" + exit 3 + } + [ -f "$config_env" ] || { + echo "Config: wrong path for config enviroment" + exit 3 + } + + ##load project - export "`cat "$config" | grep ^[^#] | grep ^project= | cut -d "#" -f 1 | tr -d '"'`" + export "`cat "$config_file" | grep ^[^#] | grep ^project= | cut -d "#" -f 1 | tr -d '"'`" #check if project template exist [ -f "/proj/$project" ] || { @@ -21,7 +32,7 @@ function config_load() { echo; echo #space - cat "$config" | grep ^[^#] | cut -d "#" -f 1 | grep '=' | while read line; do + cat "$config_file" | grep ^[^#] | cut -d "#" -f 1 | grep '=' | while read line; do #read each var line config_key=`echo $line | cut -d "=" -f 1` config_value=`echo $line | cut -d "=" -f 2 | tr -d '"'` @@ -42,8 +53,7 @@ function config_load() { config_value="${config_value/