xr-mysql-connect (367B)
1 #!/bin/sh 2 3 # Where does your mysql live? 4 mysql=/usr/local/mysql/bin/mysql 5 6 # Get the host and port from the argument (which is the back end, 7 # as host:port) 8 host=`echo $1 | sed 's/:.*//'` 9 port=`echo $1 | sed 's/.*://'` 10 11 # Try to connect to the host and port. Print the result on stdout. 12 echo quit | $mysql -h $host -P $port --protocol=tcp --connect-timeout=3 13 echo $?