mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-20 13:02:21 +02:00
debug bootstrap/provision
This commit is contained in:
@@ -132,34 +132,13 @@ else
|
|||||||
echo "No HDMI switch found. " >> $logFile
|
echo "No HDMI switch found. " >> $logFile
|
||||||
fi
|
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
|
# FS EXPAND
|
||||||
# if a file called 'ssh.reset' gets
|
# if a file called 'ssh.reset' gets
|
||||||
# placed onto the boot part of
|
# placed onto the boot part of
|
||||||
# the sd card - delete old ssh data
|
# the sd card - delete old ssh data
|
||||||
################################
|
################################
|
||||||
|
|
||||||
source <(sudo /home/admin/config.scripts/blitz.bootdrive.sh status)
|
source <(sudo /home/admin/config.scripts/blitz.bootdrive.sh status)
|
||||||
if [ "${needsExpansion}" == "1" ] && [ "${fsexpanded}" == "0" ]; then
|
if [ "${needsExpansion}" == "1" ] && [ "${fsexpanded}" == "0" ]; then
|
||||||
echo "FSEXPAND needed ... starting process" >> $logFile
|
echo "FSEXPAND needed ... starting process" >> $logFile
|
||||||
@@ -181,6 +160,29 @@ else
|
|||||||
echo "No FS EXPAND needed. needsExpansion(${needsExpansion}) fsexpanded(${fsexpanded})" >> $logFile
|
echo "No FS EXPAND needed. needsExpansion(${needsExpansion}) fsexpanded(${fsexpanded})" >> $logFile
|
||||||
fi
|
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
|
# UASP FIX - first try
|
||||||
# if HDD is connected on start
|
# if HDD is connected on start
|
||||||
|
@@ -106,8 +106,6 @@ echo ""
|
|||||||
echo "*** Start ${network} ***" >> ${logFile}
|
echo "*** Start ${network} ***" >> ${logFile}
|
||||||
sudo sed -i "s/^message=.*/message='Blockchain Testrun'/g" ${infoFile}
|
sudo sed -i "s/^message=.*/message='Blockchain Testrun'/g" ${infoFile}
|
||||||
echo "- This can take a while .." >> ${logFile}
|
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 cp /home/admin/assets/${network}d.service /etc/systemd/system/${network}d.service
|
||||||
sudo systemctl enable ${network}d.service
|
sudo systemctl enable ${network}d.service
|
||||||
sudo systemctl start ${network}d.service
|
sudo systemctl start ${network}d.service
|
||||||
|
Reference in New Issue
Block a user