reduced debug

This commit is contained in:
Christian Rotzoll
2019-04-17 04:44:05 +01:00
parent 98baf5f688
commit b4cd4cb0d7

View File

@@ -158,12 +158,12 @@ do
# check every 1min # check every 1min
recheckSCB=$(($counter % 60)) recheckSCB=$(($counter % 60))
if [ ${recheckSCB} -eq 1 ]; then if [ ${recheckSCB} -eq 1 ]; then
echo "SCB Monitoring ..." #echo "SCB Monitoring ..."
source ${configFile} source ${configFile}
# check if channel.backup exists # check if channel.backup exists
scbExists=$(sudo ls /mnt/hdd/lnd/data/chain/${network}/${chain}net/channel.backup 2>/dev/null | grep -c 'channel.backup') scbExists=$(sudo ls /mnt/hdd/lnd/data/chain/${network}/${chain}net/channel.backup 2>/dev/null | grep -c 'channel.backup')
if [ ${scbExists} -eq 1 ]; then if [ ${scbExists} -eq 1 ]; then
echo "Found Channel Backup File .. check if changed .." #echo "Found Channel Backup File .. check if changed .."
md5checksumORG=$(sudo md5sum /mnt/hdd/lnd/data/chain/${network}/${chain}net/channel.backup 2>/dev/null | head -n1 | cut -d " " -f1) md5checksumORG=$(sudo md5sum /mnt/hdd/lnd/data/chain/${network}/${chain}net/channel.backup 2>/dev/null | head -n1 | cut -d " " -f1)
md5checksumCPY=$(sudo md5sum /home/admin/.lnd/data/chain/${network}/${chain}net/channel.backup 2>/dev/null | head -n1 | cut -d " " -f1) md5checksumCPY=$(sudo md5sum /home/admin/.lnd/data/chain/${network}/${chain}net/channel.backup 2>/dev/null | head -n1 | cut -d " " -f1)
if [ "${md5checksumORG}" != "${md5checksumCPY}" ]; then if [ "${md5checksumORG}" != "${md5checksumCPY}" ]; then
@@ -206,12 +206,12 @@ do
echo "OK - ${upload}" echo "OK - ${upload}"
fi fi
fi fi
else #else
echo "Channel Backup File not changed." # echo "Channel Backup File not changed."
fi fi
else #else
echo "No Channel Backup File .." # echo "No Channel Backup File .."
fi fi
fi fi
@@ -223,25 +223,25 @@ do
recheckSync=$(($counter % 300)) recheckSync=$(($counter % 300))
if [ ${recheckSync} -eq 1 ]; then if [ ${recheckSync} -eq 1 ]; then
source ${configFile} source ${configFile}
echo "LND MONITOR LOST SYNC ..." #echo "LND MONITOR LOST SYNC ..."
lndSynced=$(sudo -u bitcoin /usr/local/bin/lncli --chain=${network} --network=${chain}net getinfo 2>/dev/null | jq -r '.synced_to_chain' | grep -c true) lndSynced=$(sudo -u bitcoin /usr/local/bin/lncli --chain=${network} --network=${chain}net getinfo 2>/dev/null | jq -r '.synced_to_chain' | grep -c true)
echo "lndSynced(${lndSynced})" #echo "lndSynced(${lndSynced})"
echo "syncedSince(${syncedSince})" #echo "syncedSince(${syncedSince})"
echo "lastSyncState(${lastSyncState})" #echo "lastSyncState(${lastSyncState})"
if [ ${lndSynced} -eq ${lastSyncState} ]; then if [ ${lndSynced} -eq ${lastSyncState} ]; then
echo "no sync change" echo "no sync change"
if [ ${lndSynced} -eq 1 ]; then if [ ${lndSynced} -eq 1 ]; then
echo "all is good - LND still in sync now for:" #echo "all is good - LND still in sync now for:"
actualSecondsTimestamp=$(date +%s) actualSecondsTimestamp=$(date +%s)
secondsInSync=$(echo "${actualSecondsTimestamp}-"${syncedSince} | bc) secondsInSync=$(echo "${actualSecondsTimestamp}-"${syncedSince} | bc)
#echo "${secondsInSync} seconds" #echo "${secondsInSync} seconds"
# when >10min in sync # when >10min in sync
if [ ${secondsInSync} -gt 3600 ]; then if [ ${secondsInSync} -gt 3600 ]; then
echo "LND in sync for longer then 1 hour" #echo "LND in sync for longer then 1 hour"
if [ "${backupTorrentSeeding}" == "on" ]; then if [ "${backupTorrentSeeding}" == "on" ]; then
echo "Backup Torrent Seeding is ON - check if already running" #echo "Backup Torrent Seeding is ON - check if already running"
source <(sudo -u admin /home/admin/50torrentHDD.sh status) source <(sudo -u admin /home/admin/50torrentHDD.sh status)
if [ "${baseSeeding}" == "0" ] || [ "${updateSeeding}" == "0" ]; then if [ "${baseSeeding}" == "0" ] || [ "${updateSeeding}" == "0" ]; then
echo "---> STARTING Backup Torrent Seeding" echo "---> STARTING Backup Torrent Seeding"
@@ -251,7 +251,7 @@ do
fi fi
else else
echo "still not in sync" #echo "still not in sync"
if [ ${syncedSince} -gt 0 ]; then if [ ${syncedSince} -gt 0 ]; then
echo "was in sync at least once since rinning but lost now for:" echo "was in sync at least once since rinning but lost now for:"