From 4301cf6b8a575ed03e2e1bbbcf15b18fa209defd Mon Sep 17 00:00:00 2001 From: Christian Rotzoll Date: Wed, 24 Apr 2019 23:56:43 +0200 Subject: [PATCH] filtering data --- home.admin/config.scripts/blitz.statusscan.sh | 8 ++++---- home.admin/config.scripts/blitz.systemd.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/home.admin/config.scripts/blitz.statusscan.sh b/home.admin/config.scripts/blitz.statusscan.sh index 93dd96a..49e001e 100644 --- a/home.admin/config.scripts/blitz.statusscan.sh +++ b/home.admin/config.scripts/blitz.statusscan.sh @@ -43,11 +43,11 @@ if [ ${bitcoinRunning} -eq 1 ]; then # check if error on request blockchaininfo=$(cat /mnt/hdd/temp/.bitcoind.out 2>/dev/null) bitcoinError=$(cat /mnt/hdd/temp/.bitcoind.error 2>/dev/null) - rm /mnt/hdd/temp/.bitcoind.error 2>/dev/null + #rm /mnt/hdd/temp/.bitcoind.error 2>/dev/null if [ ${#bitcoinError} -gt 0 ]; then bitcoinErrorShort=$(echo ${bitcoinError/error*:/} | sed 's/[^a-zA-Z0-9 ]//g') echo "bitcoinErrorShort='${bitcoinErrorShort}'" - bitcoinErrorFull=$(echo ${bitcoinError} | sed 's/[^a-zA-Z0-9 ]//g') + bitcoinErrorFull=$(echo ${bitcoinError} | tr -d "'") echo "bitcoinErrorFull='${bitcoinErrorFull}'" else @@ -94,7 +94,7 @@ else # if still no error identified - search logs for genereic error if [ ${#bitcoinErrorShort} -eq 0 ]; then - bitcoinErrorFull=$(sudo tail -n 250 /mnt/hdd/${network}${pathAdd}/debug.log | grep -c "Error:" | tail -1 | sed 's/[^a-zA-Z0-9 ]//g') + bitcoinErrorFull=$(sudo tail -n 100 /mnt/hdd/${network}${pathAdd}/debug.log | grep -c "Error:" | tail -1 | tr -d "'") if [ ${#bitcoinErrorFull} -gt 0 ]; then bitcoinErrorShort="Error found in Logs" fi @@ -125,7 +125,7 @@ if [ ${lndRunning} -eq 1 ]; then # check if error on request lndErrorFull=$(cat /mnt/hdd/temp/.lnd.error 2>/dev/null) lndErrorShort='' - rm /mnt/hdd/temp/.lnd.error 2>/dev/null + #rm /mnt/hdd/temp/.lnd.error 2>/dev/null if [ ${#lndError} -gt 0 ]; then diff --git a/home.admin/config.scripts/blitz.systemd.sh b/home.admin/config.scripts/blitz.systemd.sh index de6037d..0d6c474 100644 --- a/home.admin/config.scripts/blitz.systemd.sh +++ b/home.admin/config.scripts/blitz.systemd.sh @@ -15,5 +15,5 @@ fi # writing log file entry logFile="/home/admin/systemd.${2}.log" -echo "${3} $(date +%s)" >> ${logFile} +echo "$(date +%s) ${3}" >> ${logFile} echo "# OK: log '${3}' written to ${logFile}" \ No newline at end of file