Eolisation de l'applicatif MSE
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

nginxSync.sh 402B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. [[ $(CreoleGet "is_mse_master" non ) == "non" ]] && exit 0
  3. RSYNC="/usr/bin/rsync"
  4. HOST="${!#}"
  5. HOST=${HOST%:*}
  6. ${RSYNC} "$@"
  7. result=$?
  8. if [ $result -eq 0 ]
  9. then
  10. echo "#### Working on ${HOST}"
  11. # Redémarrage service nginx
  12. cmd="service php5.6-fpm restart;"
  13. cmd="${cmd} service nginx restart;"
  14. ssh ${HOST} "${cmd}"
  15. echo "### Work on ${HOST} DONE"
  16. fi
  17. exit $result