#! /bin/sh
# /home/scripts_shell/update_sphinx_documentation_v2.sh
  
echo "-------------------------------------------"
echo "suppression du dossier build ..."
sudo rm -dr /home/sphinx/build
echo " "
  

cd /home/sphinx/

echo "-------------------------------------------"
echo "compilation des pages html ..."
sudo make html
echo " "

echo "-------------------------------------------"
echo "copie vers /var/www/html/documentation/ ..."
sudo cp -R /home/sphinx/build/html/* /var/www/html/v2/documentation/
echo " "

echo "-------------------------------------------"
echo "copie des fichiers contact ..."
cd   /var/www/html/v2/documentation/5_contact/
sudo rm -f contact.php
sudo mv contact.html contact.php
sudo cp /home/sphinx/source/5_contact/contact.html  /var/www/html/v2/documentation/5_contact/contact.html
echo " "

echo "-------------------------------------------"
echo "création du fichier compressé ..."
sudo rm -f /home/zipped_sphinx/sphinx_source_v2.zip
zip -r /home/zipped_sphinx/sphinx_source_v2.zip /home/sphinx/source/
echo " "
