diff --git a/build.sdcard/raspbianStretchDesktop.sh b/build.sdcard/raspbianStretchDesktop.sh index cad7139..ac78ac4 100644 --- a/build.sdcard/raspbianStretchDesktop.sh +++ b/build.sdcard/raspbianStretchDesktop.sh @@ -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 < /home/admin/setup.sh <> $logfile echo "***********************************************" >> $logfile -################################ -# HDD CHECK / INIT -# for the very first setup -################################ - -# check if the HDD is mounted -hddAvailable=$(ls -la /mnt/hdd 2>/dev/null) -if [ ${#hddAvailable} -eq 0 ]; then - echo "HDD is NOT available" >> $logfile - echo "TODO: Try to mount." - exit 1 -fi - - ################################ # 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/pi/setup.sh 2>/dev/null | grep -c setup.sh) +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/pi/setup.sh + sudo cat /home/admin/setup.sh # execute the after boot script - sudo /home/pi/setup.sh + sudo /home/admin/setup.sh # delete the after boot script - sudo rm /home/pi/setup.sh + 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 +################################ + +# check if the HDD is mounted +hddAvailable=$(ls -la /mnt/hdd 2>/dev/null) +if [ ${#hddAvailable} -eq 0 ]; then + echo "HDD is NOT available" >> $logfile + echo "TODO: Try to mount." + exit 1 +fi + ################################ # CONFIGFILE BASICS ################################