#! /bin/sh
# /home/scripts_shell/restore_all_AQCM05.sh

raspi-gpio set 5 op

#sudo /home/scripts_shell/AQCM05_stop_services.sh
#raspi-gpio set 5 dh
#sleep 0.002m
#raspi-gpio set 5 dl
#sleep 1

sudo unzip -o /home/boot_restore/AQCM05_boot_firmware.zip -d /
raspi-gpio set 5 dh
sleep 0.002m
raspi-gpio set 5 dl
sleep 1

sudo unzip -o /home/boot_restore/AQCM05_boot_factory.zip  -d /
raspi-gpio set 5 dh
sleep 0.002m
raspi-gpio set 5 dl
sleep 1

sudo mysql -u root -p124816aBCDeF < /home/boot_restore/AQCM05_boot_db.sql
raspi-gpio set 5 dh
sleep 0.002m
raspi-gpio set 5 dl
sleep 1

cd /var/www/html/scripts_PHP/
sudo php AQCM_boot_restore_script.php
raspi-gpio set 5 dh
sleep 0.002m
raspi-gpio set 5 dl
sleep 1

sudo /home/scripts_shell/restore_zipped_firmware_post_traitement.sh
