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.

init_bootstrap.sh 465B

1234567891011121314151617181920
  1. #!/bin/bash
  2. service {{ service.service }} start
  3. counter=${1:-60}
  4. retries=0
  5. while [ $counter -gt 0 ]
  6. do
  7. if mysql -u root -e"quit" || 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:-10}
  14. done
  15. echo "Failed to connect to the MySQL service after $retries retries."
  16. exit 1