fixes if boerse.de is down

This commit is contained in:
olli 2023-10-03 11:37:22 +02:00
parent f6960ef9de
commit e5ad736799

View File

@ -18,7 +18,18 @@ function get_boerse_de {
else else
g_echo_warn "BOERSE_DE_CMD_OUT-${f_name}.tmp has wrong Syntax. - Not updating ${f_name} Index $(tail -n 10 BOERSE_DE_CMD_OUT-${f_name}.tmp)" g_echo_warn "BOERSE_DE_CMD_OUT-${f_name}.tmp has wrong Syntax. - Not updating ${f_name} Index $(tail -n 10 BOERSE_DE_CMD_OUT-${f_name}.tmp)"
fi fi
[ -e "BOERSE_DE_CMD_OUT-${f_name}" ] || echo 0 >BOERSE_DE_CMD_OUT-${f_name} if ! [ -e "BOERSE_DE_CMD_OUT-${f_name}" ]
then
set -x
local f_old_value=$(tail -n 1 asset-histories/${f_name}.history.csv | cut -d, -f2)
if echo ${f_old_value} | egrep -q "^[0-9]*\.[0-9]+$"
then
echo ${f_old_value} >BOERSE_DE_CMD_OUT-${f_name}
else
echo 0 >BOERSE_DE_CMD_OUT-${f_name}
fi
set +x
fi
echo "${f_timestamp},$(cat BOERSE_DE_CMD_OUT-${f_name})" >>asset-histories/${f_name}.history.csv echo "${f_timestamp},$(cat BOERSE_DE_CMD_OUT-${f_name})" >>asset-histories/${f_name}.history.csv
} }