#!/bin/bash #remaster lib [ -d "" ] || { echo "LIBDIR not exist"; exit 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_file" | grep ^[^#] | grep ^project= | cut -d "#" -f 1 | tr -d '"'`" #check if project template exist [ -f "/proj/$project" ] || { echo "No Project \"$project\" is not supported" return 3 } # loard project source "/proj/$project" echo; echo #space 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 '"'` config_corect="false" #check if this is a alowed config key for i in $config_keys; do [ "$i" == "$config_key" ] && config_corect="true" done if [ "$config_corect" == "true" ]; then #load config key #replace value strings config_value="${config_value//`date '+%Y-%m-%d'`}" config_value="${config_value/