| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- #!/bin/bash
- # WAOUW v2.0 - SCRIPT FINAL D'AUTO-INSTALLATION
- # Cree automatiquement
- # INDICATEUR VISUEL IMMEDIAT
- echo "WAOUW-STARTED" > /boot/waouw-started.txt
- date >> /boot/waouw-started.txt
- # LOG COMPLET
- exec >> >(tee -a /var/log/waouw-install.log) 2>&1
- echo "=== WAOUW AUTO-INSTALL $(date) ==="
- echo "WAOUW: Script demarre..."
- # Attendre que le systeme soit pret
- echo "WAOUW: Attente systeme (30s)..."
- sleep 30
- # Attendre la connectivite reseau
- echo "WAOUW: Test reseau..."
- for i in {1..15}; do
- if ping -c 1 8.8.8.8 > /dev/null 2>&1; then
- echo "WAOUW: Reseau OK"
- break
- fi
- if [[ $i -eq 15 ]]; then
- echo "WAOUW: ERREUR - Pas de reseau"
- echo "WAOUW: Pas de reseau" > /boot/waouw-no-network.txt
- exit 1
- fi
- echo "WAOUW: Tentative reseau $i/15..."
- sleep 5
- done
- # Verifier que l'archive existe
- if [[ ! -f /boot/waouw-deploy.zip ]]; then
- echo "WAOUW: ERREUR - Archive manquante"
- echo "WAOUW: Archive manquante" > /boot/waouw-no-archive.txt
- exit 1
- fi
- echo "WAOUW: Archive trouvee, taille: $(ls -lh /boot/waouw-deploy.zip | awk '{print $5}')"
- # Creer le repertoire d'installation
- echo "WAOUW: Preparation installation..."
- mkdir -p /opt/waouw
- cd /opt/waouw
- # Decompresser l'archive
- echo "WAOUW: Decompression archive..."
- unzip -q /boot/waouw-deploy.zip
- if [[ $? -ne 0 ]]; then
- echo "WAOUW: ERREUR - Decompression echouee"
- echo "WAOUW: Decompression echouee" > /boot/waouw-decompress-error.txt
- exit 1
- fi
- echo "WAOUW: Archive decompressee"
- # Aller dans le repertoire WaouW
- cd waouw-deploy
- # Verifier que les fichiers existent
- if [[ ! -f "DEPLOY/install-complete.sh" ]]; then
- echo "WAOUW: ERREUR - Fichiers d'installation manquants"
- echo "WAOUW: Fichiers manquants" > /boot/waouw-missing-files.txt
- ls -la
- exit 1
- fi
- echo "WAOUW: Fichiers d'installation trouves"
- # Rendre les scripts executables
- echo "WAOUW: Configuration permissions..."
- chmod +x DEPLOY/*.sh
- chmod +x install.sh
- # LANCER L'INSTALLATION COMPLETE
- echo "WAOUW: LANCEMENT INSTALLATION WAOUW v2.0..."
- ./DEPLOY/install-complete.sh
- INSTALL_CODE=$?
- # Verifier le resultat
- if [[ $INSTALL_CODE -eq 0 ]]; then
- echo "WAOUW: SUCCES TOTAL !"
- touch /opt/waouw/.installed
- LOCAL_IP=$(hostname -I | awk '{print $1}')
- echo "WaouW v2.0 - INSTALLATION REUSSIE" > /boot/waouw-success.txt
- echo "IP: $LOCAL_IP" >> /boot/waouw-success.txt
- echo "Acces: http://waouw.local:7165" >> /boot/waouw-success.txt
- echo "Date: $(date)" >> /boot/waouw-success.txt
- echo "WAOUW: Installation terminee avec succes"
- else
- echo "WAOUW: ERREUR INSTALLATION (code: $INSTALL_CODE)"
- echo "WaouW v2.0 - ERREUR (code: $INSTALL_CODE)" > /boot/waouw-error.txt
- echo "Date: $(date)" >> /boot/waouw-error.txt
- fi
- echo "=== WAOUW AUTO-INSTALL TERMINE $(date) ==="
- echo "WAOUW-FINISHED" > /boot/waouw-finished.txt
- date >> /boot/waouw-finished.txt
|