added wget timeout opts

This commit is contained in:
olli 2024-02-13 16:46:05 +01:00
parent 5d52653e6c
commit 32c5ba2caa
4 changed files with 8 additions and 6 deletions

View File

@ -248,7 +248,7 @@ cp -r strategies analyze-${analyzedate}/
analyzecounter=0 analyzecounter=0
## Chart Part ## Chart Part
#[ -e data/charts.min.css ] || wget -q https://raw.githubusercontent.com/ChartsCSS/charts.css/main/dist/charts.min.css -O data/charts.min.css #[ -e data/charts.min.css ] || wget ${g_wget_opts} -q https://raw.githubusercontent.com/ChartsCSS/charts.css/main/dist/charts.min.css -O data/charts.min.css
## Chart Part End ## Chart Part End
for file in $@ for file in $@

View File

@ -10,6 +10,8 @@ BASEPATH=/dabo/htdocs
g_tries=13 g_tries=13
g_tries_delay=23 g_tries_delay=23
g_wget_opts="--timeout 10 --tries=2"
### FUNCTIONS ### ### FUNCTIONS ###
for bashfunc in $(find ${BASEPATH}/../functions -type f -name "*.sh") for bashfunc in $(find ${BASEPATH}/../functions -type f -name "*.sh")
do do

View File

@ -35,10 +35,10 @@ function get_marketdata_from_url {
# check source platform for parsing parameters, prepare and run wget command # check source platform for parsing parameters, prepare and run wget command
>MARKET_DATA_CMD >MARKET_DATA_CMD
echo ${f_url} | grep -q "boerse.de" && echo "wget -q -O - ${f_url} | egrep 'itemprop=\"price\" content=\"[0-9]+\.[0-9]+\"' | sed s'#\"#\n#g' | egrep '^[0-9]+\.[0-9]+'" >MARKET_DATA_CMD echo ${f_url} | grep -q "boerse.de" && echo "wget ${g_wget_opts} -q -O - ${f_url} | egrep 'itemprop=\"price\" content=\"[0-9]+\.[0-9]+\"' | sed s'#\"#\n#g' | egrep '^[0-9]+\.[0-9]+'" >MARKET_DATA_CMD
echo ${f_url} | egrep -q "investing.com.+economic-calendar" && echo "wget -q -O - ${f_url} | egrep 'Actual.+Forecast.+Previous' | cut -d'>' -f7,11 | cut -d'<' -f1,2 | sed 's#,##g' | sed 's#\%##g' | sed 's#</div>#,#' | grep '[0-9]'" >MARKET_DATA_CMD echo ${f_url} | egrep -q "investing.com.+economic-calendar" && echo "wget ${g_wget_opts} -q -O - ${f_url} | egrep 'Actual.+Forecast.+Previous' | cut -d'>' -f7,11 | cut -d'<' -f1,2 | sed 's#,##g' | sed 's#\%##g' | sed 's#</div>#,#' | grep '[0-9]'" >MARKET_DATA_CMD
echo ${f_url} | egrep -q "investing.com.+indices" && echo "wget -q -O - ${f_url} | sed 's#</div>#\n#g' | grep 'text-5xl.*font-bold.*md:text-' | sed 's#^.*>##; s#,##g' | grep '[0-9]'" >MARKET_DATA_CMD echo ${f_url} | egrep -q "investing.com.+indices" && echo "wget ${g_wget_opts} -q -O - ${f_url} | sed 's#</div>#\n#g' | grep 'text-5xl.*font-bold.*md:text-' | sed 's#^.*>##; s#,##g' | grep '[0-9]'" >MARKET_DATA_CMD
[ -s MARKET_DATA_CMD ] || echo "wget -q -O - ${f_url}" >MARKET_DATA_CMD [ -s MARKET_DATA_CMD ] || echo "wget ${g_wget_opts} -q -O - ${f_url}" >MARKET_DATA_CMD
g_runcmd g_retrycmd sh MARKET_DATA_CMD >MARKET_DATA_CMD_OUT-${f_name}.tmp 2>MARKET_DATA_CMD_OUT-${f_name}.tmp.err g_runcmd g_retrycmd sh MARKET_DATA_CMD >MARKET_DATA_CMD_OUT-${f_name}.tmp 2>MARKET_DATA_CMD_OUT-${f_name}.tmp.err

View File

@ -4,7 +4,7 @@ function webpage {
g_echo_note "RUNNING FUNCTION ${FUNCNAME} $@" g_echo_note "RUNNING FUNCTION ${FUNCNAME} $@"
# Get charts.css # Get charts.css
[ -e ../charts.min.css ] || wget -q https://raw.githubusercontent.com/ChartsCSS/charts.css/main/dist/charts.min.css -O ../charts.min.css [ -e ../charts.min.css ] || wget ${g_wget_opts} -q https://raw.githubusercontent.com/ChartsCSS/charts.css/main/dist/charts.min.css -O ../charts.min.css
# create status webpage # create status webpage
echo "<html> echo "<html>