Saltstack Official Galera Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

22 行
392B

  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