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 392B

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