#673 detecting more the 1GB RAM & config bitcoind

This commit is contained in:
Christian Rotzoll 2019-07-28 23:26:14 +02:00
parent 9ecbcd0d0c
commit b9a8220003
2 changed files with 16 additions and 0 deletions

View File

@ -35,6 +35,14 @@ if [ ${mountOK} -eq 1 ]; then
sudo chown -R bitcoin:bitcoin /home/bitcoin/.lnd
echo "OK - ${network} setup ready"
###### OPTIMIZE IF RAM >1GB
kbSizeRAM=$(cat /proc/meminfo | grep "MemTotal" | sed 's/[^0-9]*//g')
if [ ${kbSizeRAM} -gt 1500000 ]; then
echo "Detected RAM >1GB --> optimizing ${network}.conf"
sudo sed -i "s/^dbcache=.*/dbcache=600/g" /mnt/hdd/${network}/${network}.conf
sudo sed -i "s/^maxmempool=.*/maxmempool=300/g" /mnt/hdd/${network}/${network}.conf
fi
###### ACTIVATE TOR IF SET DURING SETUP
if [ "${runBehindTor}" = "on" ]; then
echo "TOR was selected ..."

View File

@ -57,6 +57,14 @@ fi
sudo rm -rf /etc/ssh >> ${logFile} 2>&1
sudo ln -s /mnt/hdd/ssh /etc/ssh >> ${logFile} 2>&1
# optimze if RAM >1GB
kbSizeRAM=$(cat /proc/meminfo | grep "MemTotal" | sed 's/[^0-9]*//g')
if [ ${kbSizeRAM} -gt 1500000 ]; then
echo "Detected RAM >1GB --> optimizing ${network}.conf"
sudo sed -i "s/^dbcache=.*/dbcache=600/g" /mnt/hdd/${network}/${network}.conf
sudo sed -i "s/^maxmempool=.*/maxmempool=300/g" /mnt/hdd/${network}/${network}.conf
fi
# link and copy HDD content into new OS
echo "Link HDD content for user bitcoin" >> ${logFile}
sudo chown -R bitcoin:bitcoin /mnt/hdd/lnd >> ${logFile} 2>&1