| 1234567891011121314151617181920212223242526 |
- #!/bin/bash
- FRONT_PATH="/var/www/opentalent-admin/prod"
- MAINTENANCE_PATH="/var/opentalent/git/devops/Maintenance"
- echo "Maintenance ON ou OFF ?"
- read response
- if [ $response == 'ON' ]; then
- echo "Message de fin de maintenance (exemple : le vendredi 16 décembre à 8h00) ?"
- read message
- cp -f ${MAINTENANCE_PATH}/maintenance.html ${FRONT_PATH}/maintenance.html
- sed -i "s/<span id='date_dispo'>.*<\/span>/<span id='date_dispo'>${message}<\/span>/g" ${FRONT_PATH}/maintenance.html
- cp -f ${MAINTENANCE_PATH}/.htaccess_maintenance_on ${FRONT_PATH}/.htaccess
- ssh -t exploitation@prod-back "touch /tmp/MAINTENANCE"
- echo "Maintenance ON"
- elif [ $response == 'OFF' ]; then
- cp -f ${MAINTENANCE_PATH}/.htaccess_maintenance_off ${FRONT_PATH}/.htaccess
- ssh -t exploitation@prod-back "rm /tmp/MAINTENANCE"
- echo "Maintenance OFF"
- else
- echo "Le choix doit être ON ou OFF"
- fi
|