Arreglos varios #6
3 changed files with 4 additions and 3 deletions
|
@ -45,8 +45,8 @@ json="{\"transaction_uuid\":\"$uuid\",\"controller_id\":\"$name\",\"timestamp\":
|
||||||
touch $install_dir/lock
|
touch $install_dir/lock
|
||||||
file=$(date +%Y%m%d%H%M%S)-$(uuidgen)
|
file=$(date +%Y%m%d%H%M%S)-$(uuidgen)
|
||||||
for ((i=1 ; i <=3 ; i++));do
|
for ((i=1 ; i <=3 ; i++));do
|
||||||
if echo $json | jsonlint-php 2> /dev/null;then
|
if echo $json | $json_linter >/dev/null 2>&1 ;then
|
||||||
echo $json > /opt/nodemecu/stack/$file && rm /opt/nodemecu/lock && echo $((counter+1)) > $install_dir/counter && break
|
echo $json > $install_dir/stack/$file && rm $install_dir/lock && echo $((counter+1)) > $install_dir/counter && break
|
||||||
else
|
else
|
||||||
echo "$(date +%Y-%m-%d-%H:%M:%S) - No se pudo obtener información." >> $install_dir/errors.log && sleep 1
|
echo "$(date +%Y-%m-%d-%H:%M:%S) - No se pudo obtener información." >> $install_dir/errors.log && sleep 1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -2,6 +2,7 @@ url=https://ectomobile.sutty.nl/transactions
|
||||||
name=
|
name=
|
||||||
interval=
|
interval=
|
||||||
mode=test
|
mode=test
|
||||||
|
json_linter=jsonlint-php
|
||||||
|
|
||||||
|
|
||||||
# AJUSTES GENERALES
|
# AJUSTES GENERALES
|
||||||
|
|
|
@ -9,7 +9,7 @@ shopt -s nullglob
|
||||||
# Revisando stack
|
# Revisando stack
|
||||||
|
|
||||||
for filename in $install_dir/stack/*;do
|
for filename in $install_dir/stack/*;do
|
||||||
jq $filename >/dev/null 2>&1 || mv -v $filename $corrupt
|
$json_linter $filename >/dev/null 2>&1 || mv -v $filename $corrupt
|
||||||
done
|
done
|
||||||
|
|
||||||
while :;do
|
while :;do
|
||||||
|
|
Loading…
Reference in a new issue