telnet 交互

#!/bin/bash
Ip="10.0.1.53"
a="\{\'method\'\:\'doLogin\'\,\'params\'\:\{\'uName\'\:\'bobbietest\'\}"
/usr/bin/expect -c"
        set timeout 15
        spawn telnet ${Ip} 8000
        expect "Escape"
        send "${a}\\r"
        expect {
-re "\"err.*none\"" {
        exit 0
}
timeout {                       
        exit 1
}
eof {
        exit 2
}
        }
"
echo $?

 

相关文章:

  • 2022-02-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-05
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
猜你喜欢
  • 2022-12-23
  • 2021-10-05
  • 2021-11-15
  • 2022-12-23
  • 2021-12-27
  • 2021-10-08
  • 2022-02-17
相关资源
相似解决方案