mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-03-27 02:01:53 +01:00
fix after boot setup script
This commit is contained in:
parent
16780f28ba
commit
c1dcbe6e4a
@ -372,14 +372,14 @@ sudo bash -c 'echo "SCRIPT=/home/admin/00infoLCD.sh" >> /home/pi/.bashrc'
|
||||
sudo bash -c 'echo "# replace shell with script => logout when exiting script" >> /home/pi/.bashrc'
|
||||
sudo bash -c 'echo "exec \$SCRIPT" >> /home/pi/.bashrc'
|
||||
|
||||
# create /home/pi/setup.sh - which will get executed after reboot by autologin pi user
|
||||
cat > /home/pi/setup.sh <<EOF
|
||||
# create /home/admin/setup.sh - which will get executed after reboot by autologin pi user
|
||||
cat > /home/admin/setup.sh <<EOF
|
||||
|
||||
# make LCD screen rotation correct
|
||||
sudo sed --in-place -i "57s/.*/dtoverlay=tft35a:rotate=270/" /boot/config.txt
|
||||
|
||||
EOF
|
||||
sudo chmod +x /home/pi/setup.sh
|
||||
sudo chmod +x /home/admin/setup.sh
|
||||
|
||||
echo ""
|
||||
echo "*** HARDENING ***"
|
||||
|
@ -17,6 +17,29 @@ date >> $logfile
|
||||
echo "***********************************************" >> $logfile
|
||||
|
||||
|
||||
################################
|
||||
# AFTER BOOT SCRIPT
|
||||
# when a process needs to
|
||||
# execute stuff after a reboot
|
||||
# /home/admin/setup.sh
|
||||
################################
|
||||
|
||||
# check for after boot script
|
||||
afterSetupScriptExists=$(ls /home/admin/setup.sh 2>/dev/null | grep -c setup.sh)
|
||||
if [ ${afterSetupScriptExists} -eq 1 ]; then
|
||||
echo "*** SETUP SCRIPT DETECTED ***"
|
||||
# echo out script to journal logs
|
||||
sudo cat /home/admin/setup.sh
|
||||
# execute the after boot script
|
||||
sudo /home/admin/setup.sh
|
||||
# delete the after boot script
|
||||
sudo rm /home/admin/setup.sh
|
||||
# reboot again
|
||||
echo "DONE wait 6 secs ... one more reboot needed ... "
|
||||
sudo shutdown -r now
|
||||
sleep 100
|
||||
fi
|
||||
|
||||
################################
|
||||
# HDD CHECK / INIT
|
||||
# for the very first setup
|
||||
@ -30,29 +53,6 @@ if [ ${#hddAvailable} -eq 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
################################
|
||||
# AFTER BOOT SCRIPT
|
||||
# when a process needs to
|
||||
# execute stuff after a reboot
|
||||
################################
|
||||
|
||||
# check for after boot script
|
||||
afterSetupScriptExists=$(ls /home/pi/setup.sh 2>/dev/null | grep -c setup.sh)
|
||||
if [ ${afterSetupScriptExists} -eq 1 ]; then
|
||||
echo "*** SETUP SCRIPT DETECTED ***"
|
||||
# echo out script to journal logs
|
||||
sudo cat /home/pi/setup.sh
|
||||
# execute the after boot script
|
||||
sudo /home/pi/setup.sh
|
||||
# delete the after boot script
|
||||
sudo rm /home/pi/setup.sh
|
||||
# reboot again
|
||||
echo "DONE wait 6 secs ... one more reboot needed ... "
|
||||
sudo shutdown -r now
|
||||
sleep 100
|
||||
fi
|
||||
|
||||
################################
|
||||
# CONFIGFILE BASICS
|
||||
################################
|
||||
|
Loading…
x
Reference in New Issue
Block a user