Initial commit (code), runtime ignoré, secrets exclus
This commit is contained in:
85
module/installer_resultats.sh
Normal file
85
module/installer_resultats.sh
Normal file
@ -0,0 +1,85 @@
|
||||
#!/bin/bash
|
||||
# ============================================================================
|
||||
# INSTALLATION MODULE RÉSULTATS ÉVALUATION
|
||||
# Date: 02/11/2025
|
||||
# Fichiers: resultats_evaluation.php + resultats_ajax.php
|
||||
# ============================================================================
|
||||
|
||||
echo "==================================================================="
|
||||
echo " INSTALLATION MODULE RÉSULTATS ÉVALUATION"
|
||||
echo "==================================================================="
|
||||
echo ""
|
||||
|
||||
# Variables
|
||||
SOURCE_DIR="."
|
||||
DEST_DIR="/var/www/mathematiques/enseignant"
|
||||
BACKUP_DIR="/var/www/mathematiques/backup"
|
||||
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
|
||||
|
||||
# Vérification fichiers sources
|
||||
if [ ! -f "$SOURCE_DIR/resultats_evaluation.php" ]; then
|
||||
echo "❌ Erreur: resultats_evaluation.php introuvable"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$SOURCE_DIR/resultats_ajax.php" ]; then
|
||||
echo "❌ Erreur: resultats_ajax.php introuvable"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Fichiers sources trouvés"
|
||||
echo ""
|
||||
|
||||
# Créer dossier backup
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
|
||||
# Backup si fichiers existants
|
||||
if [ -f "$DEST_DIR/resultats_evaluation.php" ]; then
|
||||
echo "💾 Backup anciens fichiers..."
|
||||
cp "$DEST_DIR/resultats_evaluation.php" "$BACKUP_DIR/resultats_evaluation_${TIMESTAMP}.php"
|
||||
echo " → $BACKUP_DIR/resultats_evaluation_${TIMESTAMP}.php"
|
||||
fi
|
||||
|
||||
if [ -f "$DEST_DIR/resultats_ajax.php" ]; then
|
||||
cp "$DEST_DIR/resultats_ajax.php" "$BACKUP_DIR/resultats_ajax_${TIMESTAMP}.php"
|
||||
echo " → $BACKUP_DIR/resultats_ajax_${TIMESTAMP}.php"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
# Copier fichiers
|
||||
echo "📦 Copie fichiers..."
|
||||
cp "$SOURCE_DIR/resultats_evaluation.php" "$DEST_DIR/"
|
||||
cp "$SOURCE_DIR/resultats_ajax.php" "$DEST_DIR/"
|
||||
|
||||
# Permissions
|
||||
echo "🔐 Configuration permissions..."
|
||||
chown www-data:www-data "$DEST_DIR/resultats_evaluation.php"
|
||||
chown www-data:www-data "$DEST_DIR/resultats_ajax.php"
|
||||
chmod 644 "$DEST_DIR/resultats_evaluation.php"
|
||||
chmod 644 "$DEST_DIR/resultats_ajax.php"
|
||||
|
||||
echo ""
|
||||
echo "✅ Installation terminée !"
|
||||
echo ""
|
||||
|
||||
# Vérification
|
||||
echo "📋 Vérification installation:"
|
||||
ls -lh "$DEST_DIR/resultats_evaluation.php"
|
||||
ls -lh "$DEST_DIR/resultats_ajax.php"
|
||||
|
||||
echo ""
|
||||
echo "==================================================================="
|
||||
echo " PROCHAINES ÉTAPES"
|
||||
echo "==================================================================="
|
||||
echo ""
|
||||
echo "1. Recharger PHP-FPM:"
|
||||
echo " sudo systemctl reload php8.1-fpm"
|
||||
echo ""
|
||||
echo "2. Tester interface:"
|
||||
echo " http://82.67.167.147/mathematiques/enseignant/resultats_evaluation.php?id_evaluation=23"
|
||||
echo ""
|
||||
echo "3. Vérifier API:"
|
||||
echo " http://82.67.167.147/mathematiques/enseignant/resultats_ajax.php?id_evaluation=23"
|
||||
echo ""
|
||||
echo "==================================================================="
|
||||
Reference in New Issue
Block a user