mirror of
https://github.com/rapid7/metasploitable3.git
synced 2024-07-20 00:00:13 +02:00
23 lines
651 B
Plaintext
23 lines
651 B
Plaintext
|
#!/bin/sh
|
||
|
|
||
|
# Wait for the server to come up
|
||
|
ret=0
|
||
|
while /bin/true; do
|
||
|
RESPONSE=`/usr/bin/mysqladmin --no-defaults --socket="<%= @socket_file %>" --user=UNKNOWN_MYSQL_USER ping 2>&1`
|
||
|
mret=$?
|
||
|
if [ $mret -eq 0 ]; then
|
||
|
break
|
||
|
fi
|
||
|
# exit codes 1, 11 (EXIT_CANNOT_CONNECT_TO_SERVICE) are expected,
|
||
|
# anything else suggests a configuration error
|
||
|
if [ $mret -ne 1 -a $mret -ne 11 ]; then
|
||
|
ret=1
|
||
|
break
|
||
|
fi
|
||
|
# "Access denied" also means the server is alive
|
||
|
echo "$RESPONSE" | grep -q "Access denied for user" && break
|
||
|
sleep 1
|
||
|
done
|
||
|
|
||
|
exit $ret
|