debug bootstrap/provision

This commit is contained in:
rootzoll
2021-08-20 00:20:16 +02:00
parent e3cd075245
commit 48d974415b
2 changed files with 24 additions and 24 deletions

View File

@@ -132,34 +132,13 @@ else
echo "No HDMI switch found. " >> $logFile
fi
################################
# SSH SERVER CERTS RESET
# if a file called 'ssh.reset' gets
# placed onto the boot part of
# the sd card - delete old ssh data
################################
sshReset=$(sudo ls /boot/ssh.reset* 2>/dev/null | grep -c reset)
if [ ${sshReset} -eq 1 ]; then
# delete that file (to prevent loop)
sudo rm /boot/ssh.reset* >> $logFile
# delete ssh certs
echo "SSHRESET switch found ... stopping SSH and deleting old certs" >> $logFile
sudo systemctl stop sshd >> $logFile
sudo rm /mnt/hdd/ssh/ssh_host* >> $logFile
sudo ssh-keygen -A >> $logFile
systemInitReboot=1
sed -i "s/^message=.*/message='SSHRESET'/g" ${infoFile}
else
echo "No SSHRESET switch found. " >> $logFile
fi
################################
# FS EXPAND
# if a file called 'ssh.reset' gets
# placed onto the boot part of
# the sd card - delete old ssh data
################################
source <(sudo /home/admin/config.scripts/blitz.bootdrive.sh status)
if [ "${needsExpansion}" == "1" ] && [ "${fsexpanded}" == "0" ]; then
echo "FSEXPAND needed ... starting process" >> $logFile
@@ -181,6 +160,29 @@ else
echo "No FS EXPAND needed. needsExpansion(${needsExpansion}) fsexpanded(${fsexpanded})" >> $logFile
fi
################################
# SSH SERVER CERTS RESET
# if a file called 'ssh.reset' gets
# placed onto the boot part of
# the sd card - delete old ssh data
################################
sshReset=$(sudo ls /boot/ssh.reset* 2>/dev/null | grep -c reset)
if [ ${sshReset} -eq 1 ]; then
# delete that file (to prevent loop)
sudo rm /boot/ssh.reset* >> $logFile
# delete ssh certs
echo "SSHRESET switch found ... stopping SSH and deleting old certs" >> $logFile
sudo systemctl stop sshd >> $logFile
sudo rm /etc/ssh/ssh_host_*
sudo rm /mnt/hdd/ssh/ssh_host* >> $logFile
sudo ssh-keygen -A >> $logFile
systemInitReboot=1
sed -i "s/^message=.*/message='SSHRESET'/g" ${infoFile}
else
echo "No SSHRESET switch found. " >> $logFile
fi
################################
# UASP FIX - first try
# if HDD is connected on start

View File

@@ -106,8 +106,6 @@ echo ""
echo "*** Start ${network} ***" >> ${logFile}
sudo sed -i "s/^message=.*/message='Blockchain Testrun'/g" ${infoFile}
echo "- This can take a while .." >> ${logFile}
sudo systemctl stop ${network}d.service
sudo systemctl disable ${network}d.service
sudo cp /home/admin/assets/${network}d.service /etc/systemd/system/${network}d.service
sudo systemctl enable ${network}d.service
sudo systemctl start ${network}d.service