Pārlūkot izejas kodu

Tunne bootstrap scripts

feature/tunne_bootstrapscrips
Petr Michalec pirms 7 gadiem
vecāks
revīzija
e8d39b6576
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam
2 mainītis faili ar 8 papildinājumiem un 10 dzēšanām
  1. +4
    -5
      galera/files/bootstrap.sh
  2. +4
    -5
      galera/files/init_bootstrap.sh

+ 4
- 5
galera/files/bootstrap.sh Parādīt failu

@@ -1,20 +1,19 @@
#!/bin/bash
#!/bin/sh

service {{ service.service }} start

counter=60
counter=${1:-60}
retries=0

while [ $counter -gt 0 ]
do
mysql -u {{ service.admin.user }} -p{{ service.admin.password }} -e"quit"
if [[ $? -eq 0 ]]; then
if mysql -u {{ service.admin.user }} -p{{ service.admin.password }} -e"quit"; then
echo "Sucessfully connected to the MySQL service ($retries retries)."
exit 0
fi
counter=$(( counter - 1 ))
retries=$(( retries + 1 ))
sleep 4
sleep ${2:-4}
done

echo "Failed to connect to the MySQL service after $retries retries."

+ 4
- 5
galera/files/init_bootstrap.sh Parādīt failu

@@ -1,20 +1,19 @@
#!/bin/bash
#!/bin/sh

service {{ service.service }} start

counter=60
counter=${1:-60}
retries=0

while [ $counter -gt 0 ]
do
mysql -u root -e"quit"
if [[ $? -eq 0 ]]; then
if mysql -u root -e"quit"; then
echo "Sucessfully connected to the MySQL service ($retries retries)."
exit 0
fi
counter=$(( counter - 1 ))
retries=$(( retries + 1 ))
sleep 2
sleep ${2:-4}
done

echo "Failed to connect to the MySQL service after $retries retries."

Notiek ielāde…
Atcelt
Saglabāt