I use the telnet command to check if MySQL port is responding.
telnet 10.10.10.24 3306
I use the ctrl character to disconnect. This is working as expected. How do I use this command in shell script?
|
I use the telnet command to check if MySQL port is responding.
I use the ctrl character to disconnect. This is working as expected. How do I use this command in shell script?
| |||
feedback
|
|
If you're just looking to check if the port is open, try:
| |||||||
feedback
|
|
| |||||
feedback
|
|
To automate telnet script, you should use expect. See the expect home page. | ||||
|
feedback
|
|
If you don't have nc, you can use bash special files redirectons:
| |||
|
feedback
|
|
I would use netcat and it's '-w' instead; host:~ user$ nc -w 1 1.2.6.1 3306 ? 5.1.57-1~dotdeb.1?WO`rA*L#h?b4z.pmT;i~^;host:~ user$ | |||
|
feedback
|