Add "mysqladmin" as a less-invasive healthcheck for MySQL (when it's available)
This commit is contained in:
parent
8a4471517d
commit
9b04b4ce73
|
|
@ -18,8 +18,14 @@ args=(
|
||||||
--silent
|
--silent
|
||||||
)
|
)
|
||||||
|
|
||||||
if select="$(echo 'SELECT 1' | mysql "${args[@]}")" && [ "$select" = '1' ]; then
|
if command -v mysqladmin &> /dev/null; then
|
||||||
exit 0
|
if mysqladmin "${args[@]}" ping > /dev/null; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if select="$(echo 'SELECT 1' | mysql "${args[@]}")" && [ "$select" = '1' ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue