Saltstack Official Galera Formula
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.

21 line
439B

  1. #!/bin/bash
  2. service {{ service.service }} start
  3. counter=${1:-120}
  4. retries=0
  5. while [ $counter -gt 0 ]
  6. do
  7. if mysql -u {{ service.admin.user }} -p{{ service.admin.password }} -e"quit"; then
  8. echo "Sucessfully connected to the MySQL service ($retries retries)."
  9. exit 0
  10. fi
  11. counter=$(( counter - 1 ))
  12. retries=$(( retries + 1 ))
  13. sleep ${2:-4}
  14. done
  15. echo "Failed to connect to the MySQL service after $retries retries."
  16. exit 1