mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-11-18 18:07:45 +01:00
* #5076 remove datadir & correct log path * #5076 add disk full warnings
This commit is contained in:
@@ -93,7 +93,7 @@ while :
|
||||
source <(/home/admin/config.scripts/network.aliases.sh getvars)
|
||||
fi
|
||||
|
||||
if [ "${setupPhase}" != "done" ] || [ "${state}" == "reboot" ] || [ "${state}" == "shutdown" ] || [ "${state}" == "copytarget" ] || [ "${state}" == "copysource" ]; then
|
||||
if [ "${setupPhase}" != "done" ] || [ "${state}" == "reboot" ] || [ "${state}" == "shutdown" ] || [ "${state}" == "copytarget" ] || [ "${state}" == "copysource" ] || [ "${state}" = "storageisfull" ] || [ "${state}" = "dataisfull" ]; then
|
||||
|
||||
# show status info during boot & setup & repair on LCD
|
||||
if [ "${state}" == "" ]; then
|
||||
|
||||
@@ -246,6 +246,40 @@ do
|
||||
fi
|
||||
fi
|
||||
|
||||
################################
|
||||
# CHECK FULL STORAGE
|
||||
################################
|
||||
|
||||
# check every 5min
|
||||
recheckStorage=$(($counter % 300))
|
||||
if [ ${recheckStorage} -eq 1 ]; then
|
||||
|
||||
echo "*** CHECK FULL STORAGE ***"
|
||||
percent=$(df --output=pcent /mnt/disk_storage | tail -1 | tr -dc '0-9');
|
||||
if [ "${percent}" != "" ] && [ ${percent} -gt 98 ]; then
|
||||
echo "WARN # STORAGE is ${percent} - sending warning"
|
||||
/home/admin/_cache.sh set state "storageisfull"
|
||||
/home/admin/_cache.sh set message "${percent}"
|
||||
else
|
||||
echo "OK - STORAGE is at ${percent}%"
|
||||
fi
|
||||
|
||||
echo "*** CHECK FULL DATA ***"
|
||||
if mountpoint -q /mnt/disk_data; then
|
||||
percent=$(df --output=pcent /mnt/disk_data | tail -1 | tr -dc '0-9');
|
||||
if [ "${percent}" != "" ] && [ ${percent} -gt 98 ]; then
|
||||
echo "WARN # DATA is ${percent} - sending warning"
|
||||
/home/admin/_cache.sh set state "dataisfull"
|
||||
/home/admin/_cache.sh set message "${percent}"
|
||||
else
|
||||
echo "OK - DATA is at ${percent}%"
|
||||
fi
|
||||
else
|
||||
echo "OK - /mnt/disk_data not mounted"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
###############################
|
||||
# SYSTEM LOG FILE SIZES
|
||||
###############################
|
||||
|
||||
@@ -45,15 +45,15 @@ if [ "$1" == "prestart" ]; then
|
||||
case "${CHAIN}" in
|
||||
mainnet)
|
||||
bitcoinlog_entry="main.debuglogfile"
|
||||
bitcoinlog_path="/mnt/hdd/bitcoin/debug.log"
|
||||
bitcoinlog_path="/mnt/hdd/app-data/bitcoin/debug.log"
|
||||
;;
|
||||
testnet)
|
||||
bitcoinlog_entry="test.debuglogfile"
|
||||
bitcoinlog_path="/mnt/hdd/bitcoin/testnet3/debug.log"
|
||||
bitcoinlog_path="/mnt/hdd/app-data/bitcoin/testnet3/debug.log"
|
||||
;;
|
||||
signet)
|
||||
bitcoinlog_entry="signet.debuglogfile"
|
||||
bitcoinlog_path="/mnt/hdd/bitcoin/signet/debug.log"
|
||||
bitcoinlog_path="/mnt/hdd/app-data/bitcoin/signet/debug.log"
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -78,6 +78,13 @@ if [ "$1" == "prestart" ]; then
|
||||
echo "main.walletdir=/mnt/hdd/app-data/bitcoin/wallets" >> /mnt/hdd/app-data/bitcoin/bitcoin.conf
|
||||
echo "main.wallet=wallet.dat" >> /mnt/hdd/app-data/bitcoin/bitcoin.conf
|
||||
|
||||
# remove any data directory entries - is already forced by parameter in bitcoind.service
|
||||
echo "# remove any data directory entries"
|
||||
sed -i '/^datadir=/d' /mnt/hdd/app-data/bitcoin/bitcoin.conf
|
||||
sed -i '/^main.datadir=/d' /mnt/hdd/app-data/bitcoin/bitcoin.conf
|
||||
sed -i '/^test.datadir=/d' /mnt/hdd/app-data/bitcoin/bitcoin.conf
|
||||
sed -i '/^signet.datadir=/d' /mnt/hdd/app-data/bitcoin/bitcoin.conf
|
||||
|
||||
# make sure bitcoin debug file exists
|
||||
echo "# make sure bitcoin debug file exists"
|
||||
touch ${bitcoinlog_path}
|
||||
|
||||
@@ -281,6 +281,22 @@ Preparing Provision
|
||||
Please wait ...
|
||||
" 6 24
|
||||
|
||||
elif [ "${eventID}" == "storageisfull" ]; then
|
||||
|
||||
dialog --backtitle "${backtitle}" --cr-wrap --infobox "
|
||||
Your storage SSD/NVME is full (${contentString}%).
|
||||
Delete apps or migrate to a bigger drive.
|
||||
ssh admin@${internet_localip}
|
||||
" 7 50
|
||||
|
||||
elif [ "${eventID}" == "dataisfull" ]; then
|
||||
|
||||
dialog --backtitle "${backtitle}" --cr-wrap --infobox "
|
||||
Your data SSD/NVME is full (${contentString}%).
|
||||
Delete apps or migrate to a bigger drive.
|
||||
ssh admin@${internet_localip}
|
||||
" 7 50
|
||||
|
||||
elif [ "${eventID}" = "noIP-LAN" ] || [ "${eventID}" = "noIP-WIFI" ]; then
|
||||
|
||||
# this event is mostly for LCD/HDMI display
|
||||
|
||||
Reference in New Issue
Block a user