Added several new globals
This commit is contained in:
parent
b9caeb2e3c
commit
1939779f67
100
read_config
100
read_config
@ -126,15 +126,15 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
||||
# TODO: falls mehrere gruppen/zonen auftauchen hier anpassen
|
||||
readonly zgroup=1
|
||||
readonly zone=1
|
||||
readonly customer_base_dir="${__customer_base_dir}/${zgroup}/${zone}"
|
||||
if [ -d "$customer_base_dir" ]; then
|
||||
readonly CUSTOMER_BASE_DIR="${__customer_base_dir}/${zgroup}/${zone}"
|
||||
if [ -d "$CUSTOMER_BASE_DIR" ]; then
|
||||
log_debug "$func:${LINENO}: customer-base-dir="
|
||||
log_debug "$func:${LINENO}: $customer_base_dir"
|
||||
log_debug "$func:${LINENO}: $CUSTOMER_BASE_DIR"
|
||||
else
|
||||
log_fatal "$func:${LINENO}: $customer_base_dir does not exist"
|
||||
log_fatal "$func:${LINENO}: $CUSTOMER_BASE_DIR does not exist"
|
||||
fi
|
||||
|
||||
readonly psa_config_dir="${customer_base_dir}/etc/psa_config"
|
||||
readonly psa_config_dir="${CUSTOMER_BASE_DIR}/etc/psa_config"
|
||||
if [ -d "$psa_config_dir" ]; then
|
||||
log_debug "$func:${LINENO}: psa_config_dir="
|
||||
log_debug "$func:${LINENO}: $psa_config_dir"
|
||||
@ -142,7 +142,7 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
||||
log_fatal "$func:${LINENO}: $psa_config_dir does not exist"
|
||||
fi
|
||||
|
||||
readonly psa_update_dir="${customer_base_dir}/etc/psa_update"
|
||||
readonly psa_update_dir="${CUSTOMER_BASE_DIR}/etc/psa_update"
|
||||
if [ -d "$psa_update_dir" ]; then
|
||||
log_debug "$func:${LINENO}: psa_update_dir="
|
||||
log_debug "$func:${LINENO}: $psa_update_dir"
|
||||
@ -150,7 +150,7 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
||||
log_fatal "$func:${LINENO}: $psa_update_dir does not exist"
|
||||
fi
|
||||
|
||||
readonly psa_base_ini_dir="${customer_base_dir}/opt/app"
|
||||
readonly psa_base_ini_dir="${CUSTOMER_BASE_DIR}/opt/app"
|
||||
if [ -d "$psa_base_ini_dir" ]; then
|
||||
log_debug "$func:${LINENO}: psa_base_ini_dir="
|
||||
log_debug "$func:${LINENO}: $psa_base_ini_dir"
|
||||
@ -158,13 +158,14 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
||||
log_fatal "$func:${LINENO}: $psa_base_ini_dir does not exist"
|
||||
fi
|
||||
|
||||
readonly psa_sysconfig_dir="${psa_base_ini_dir}/sysconfig"
|
||||
readonly SYSCONFIG_SYS_DIR="/opt/app/sysconfig"
|
||||
readonly PSA_SYSCONFIG_DIR="$CUSTOMER_BASE_DIR$SYSCONFIG_SYS_DIR"
|
||||
# if [ -d "$psa_syconfig_dir" ]; DOES NOT WORK !!!
|
||||
if ls -al $psa_sysconfig_dir > /dev/null; then
|
||||
log_debug "$func:${LINENO}: psa_sysconfig_dir="
|
||||
log_debug "$func:${LINENO}: $psa_sysconfig_dir"
|
||||
if ls -al $PSA_SYSCONFIG_DIR > /dev/null; then
|
||||
log_debug "$func:${LINENO}: PSA_SYSCONFIG_DIR="
|
||||
log_debug "$func:${LINENO}: $PSA_SYSCONFIG_DIR"
|
||||
else
|
||||
log_error "$func:${LINENO}: $psa_sysconfig_dir does not exist"
|
||||
log_error "$func:${LINENO}: $PSA_SYSCONFIG_DIR does not exist"
|
||||
fi
|
||||
|
||||
readonly psa_ismasmgr_dir="${psa_base_ini_dir}/ISMASMgr"
|
||||
@ -175,7 +176,11 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
||||
log_fatal "$func:${LINENO}: $psa_ismasmgr_dir does not exist"
|
||||
fi
|
||||
|
||||
readonly psa_atbqt_dir="${psa_base_ini_dir}/ATBAPP"
|
||||
readonly CONF_SYS_DIR="/etc/psa_config"
|
||||
readonly OPKG_SYS_DIR="/etc/psa_update"
|
||||
readonly ATBAPP_SYS_DIR="/opt/app/ATBAPP"
|
||||
|
||||
readonly psa_atbqt_dir="$CUSTOMER_BASE_DIR$ATBAPP_SYS_DIR"
|
||||
if [ -d "$psa_atbqt_dir" ]; then
|
||||
log_debug "$func:${LINENO}: psa_atbqt_dir="
|
||||
log_debug "$func:${LINENO}: $psa_atbqt_dir"
|
||||
@ -183,44 +188,55 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
||||
log_fatal "$func:${LINENO}: $psa_atbqt_dir does not exist"
|
||||
fi
|
||||
|
||||
readonly atbqt_ini="${psa_atbqt_dir}/ATBQT.ini"
|
||||
if [ -f "$atbqt_ini" ]; then
|
||||
readonly ATBQT_INI="ATBQT.ini"
|
||||
readonly ATBQT_INI_FULL="${psa_atbqt_dir}/$ATBQT_INI"
|
||||
if [ -f "$ATBQT_INI_FULL" ]; then
|
||||
log_debug "$func:${LINENO}: ATBTQT.ini="
|
||||
log_debug "$func:${LINENO}: $atbqt_ini"
|
||||
log_debug "$func:${LINENO}: $ATBQT_INI_FULL"
|
||||
else
|
||||
log_fatal "$func:${LINENO}: $atbqt_ini does not exist"
|
||||
log_fatal "$func:${LINENO}: $ATBQT_INI_FULL does not exist"
|
||||
fi
|
||||
|
||||
readonly ismasmgr_ismasmgr_ini="${psa_ismasmgr_dir}/ISMASMgr.ini"
|
||||
if [ -f "$ismasmgr_ismasmgr_ini" ]; then
|
||||
readonly ISMASMGR_INI="ISMASMgr.ini"
|
||||
readonly ISMASMGR_SYS_DIR="/opt/app/ISMASMgr"
|
||||
|
||||
readonly ISMASMGR_ISMASMGR_INI_FULL="${psa_ismasmgr_dir}/$ISMASMGR_INI"
|
||||
if [ -f "$ISMASMGR_ISMASMGR_INI_FULL" ]; then
|
||||
log_debug "$func:${LINENO}: ismasmgr_ismasmgr.ini="
|
||||
log_debug "$func:${LINENO}: $ismasmgr_ismasmgr_ini"
|
||||
log_debug "$func:${LINENO}: $ISMASMGR_ISMASMGR_INI_FULL"
|
||||
else
|
||||
log_fatal "$func:${LINENO}: $ismasmgr_ismasmgr_ini does not exist"
|
||||
log_fatal "$func:${LINENO}: $ISMASMGR_ISMASMGR_INI_FULL "\
|
||||
"does not exist"
|
||||
fi
|
||||
|
||||
readonly sysconfig_ismasmgr_ini="${psa_sysconfig_dir}/ISMASMgr.ini"
|
||||
if [ -f "$sysconfig_ismasmgr_ini" ]; then
|
||||
readonly SYSCONFIG_ISMASMGR_INI_FULL="${PSA_SYSCONFIG_DIR}/ISMASMgr.ini"
|
||||
if [ -f "$SYSCONFIG_ISMASMGR_INI_FULL" ]; then
|
||||
log_debug "$func:${LINENO}: sysconfig_ismasmgr.ini="
|
||||
log_debug "$func:${LINENO}: $sysconfig_ismasmgr_ini"
|
||||
log_debug "$func:${LINENO}: $SYSCONFIG_ISMASMGR_INI_FULL"
|
||||
else
|
||||
log_fatal "$func:${LINENO}: $sysconfig_ismasmgr_ini does not exist"
|
||||
log_fatal "$func:${LINENO}: $SYSCONFIG_ISMASMGR_INI_FULL "\
|
||||
"does not exist"
|
||||
fi
|
||||
|
||||
readonly sysconfig_sysconfig_ini="${psa_sysconfig_dir}/sysconfig.ini"
|
||||
if [ -f "$sysconfig_sysconfig_ini" ]; then
|
||||
readonly SYS_CONFIG_INI="sysconfig.ini"
|
||||
readonly __sysc_sysc_full="${PSA_SYSCONFIG_DIR}/$SYS_CONFIG_INI"
|
||||
readonly SYSCONFIG_SYSCONFIG_INI_FULL="$__sysc_sysc_full"
|
||||
if [ -f "$SYSCONFIG_SYSCONFIG_INI_FULL" ]; then
|
||||
log_debug "$func:${LINENO}: sysconfig_sysconfig.ini="
|
||||
log_debug "$func:${LINENO}: $sysconfig_sysconfig_ini"
|
||||
log_debug "$func:${LINENO}: $SYSCONFIG_SYSCONFIG_INI_FULL"
|
||||
else
|
||||
log_fatal "$func:${LINENO}: $sysconfig_sysconfig_ini does not exist"
|
||||
log_fatal "$func:${LINENO}: "\
|
||||
"$SYSCONFIG_SYSCONFIG_INI_FULL does not exist"
|
||||
fi
|
||||
|
||||
readonly sysconfig_sysctrl_ini="${psa_sysconfig_dir}/SystemControl.ini"
|
||||
if [ -f "$sysconfig_sysctrl_ini" ]; then
|
||||
readonly "SYSTEM_CONTROL_INI"="SystemControl.ini"
|
||||
local __sysctrl_ini_full="${PSA_SYSCONFIG_DIR}/$SYSTEM_CONTROL_INI"
|
||||
readonly SYSCONFIG_SYSCTRL_INI_FULL="$__sysctrl_ini_full"
|
||||
if [ -f "$SYSCONFIG_SYSCTRL_INI_FULL" ]; then
|
||||
log_debug "$func:${LINENO}: sysconfig_systemcontrol.ini="
|
||||
log_debug "$func:${LINENO}: $sysconfig_sysctrl_ini"
|
||||
log_debug "$func:${LINENO}: $SYSCONFIG_SYSCTRL_INI_FULL"
|
||||
else
|
||||
log_fatal "$func:${LINENO}: $sysconfig_sysctrl_ini does not exist"
|
||||
log_fatal "$func:${LINENO}: $SYSCONFIG_SYSCTRL_INI_FULL does not exist"
|
||||
fi
|
||||
|
||||
readonly emp_conf="${psa_config_dir}/emp.conf"
|
||||
@ -255,17 +271,17 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once
|
||||
log_fatal "$func:${LINENO}: $opkg_cmds_file does not exist"
|
||||
fi
|
||||
|
||||
readonly KNOWN_CONF_FILES=(${CUSTOMER_LOCATION}/update.conf \
|
||||
${CUSTOMER_LOCATION}/current.conf \
|
||||
${device_conf##*${CUSTOMER_ID}/} \
|
||||
${emp_conf##*${CUSTOMER_ID}/} \
|
||||
readonly KNOWN_CONF_FILES=(${CUSTOMER_LOCATION}/update.conf \
|
||||
${CUSTOMER_LOCATION}/current.conf \
|
||||
${device_conf##*${CUSTOMER_ID}/} \
|
||||
${emp_conf##*${CUSTOMER_ID}/} \
|
||||
${printer_conf##*${CUSTOMER_ID}/})
|
||||
|
||||
readonly KNOWN_INI_FILES=(${atbqt_ini##*${CUSTOMER_ID}/} \
|
||||
${ismasmgr_ismasmgr_ini##*${CUSTOMER_ID}/} \
|
||||
${sysconfig_ismasmgr_ini##*${CUSTOMER_ID}/} \
|
||||
${sysconfig_sysconfig_ini##*${CUSTOMER_ID}/}\
|
||||
${sysconfig_sysctrl_ini##*${CUSTOMER_ID}/})
|
||||
readonly KNOWN_INI_FILES=(${ATBQT_INI_FULL##*${CUSTOMER_ID}/} \
|
||||
${ISMASMGR_ISMASMGR_INI_FULL##*${CUSTOMER_ID}/} \
|
||||
${SYSCONFIG_ISMASMGR_INI_FULL##*${CUSTOMER_ID}/} \
|
||||
${SYSCONFIG_SYSCONFIG_INI_FULL##*${CUSTOMER_ID}/} \
|
||||
${SYSCONFIG_SYSCTRL_INI_FULL##*${CUSTOMER_ID}/})
|
||||
|
||||
readonly KNOWN_FILES=(${KNOWN_CONF_FILES[@]} \
|
||||
${KNOWN_INI_FILES[@]} \
|
||||
|
Loading…
Reference in New Issue
Block a user