Blame tests/p_telnet/10-test_telnet.sh

Madhurranjan Mohaan 692517
#!/bin/bash
Madhurranjan Mohaan 692517
Madhurranjan Mohaan 692517
# Author: Madhurranjan Mohaan <madhurranjan.mohaan@gmail.com>
Madhurranjan Mohaan 692517
Madhurranjan Mohaan 692517
t_Log "Running $0 - testing telnet against ssh port"
Madhurranjan Mohaan 692517
t_Log "Making sure port 22 is listening by calling ssh installer"
Madhurranjan Mohaan 692517
../p_openssh/0-install_sshd.sh
Madhurranjan Mohaan 692517
Madhurranjan Mohaan 692517
sshd_status=`service sshd status | grep running`
Madhurranjan Mohaan 692517
if ! [ "$sshd_status" ]
Madhurranjan Mohaan 692517
then
Madhurranjan Mohaan 692517
  service sshd start
Madhurranjan Mohaan 692517
fi
Madhurranjan Mohaan 692517
Madhurranjan Mohaan 692517
telnet_port_22=`telnet 127.0.0.1 22 << EOH
Madhurranjan Mohaan 692517
EOH`
Madhurranjan Mohaan 692517
echo $telnet_port_22 | grep "Escape character is '^]'"
Madhurranjan Mohaan 692517
t_CheckExitStatus $?