#!/usr/bin/expect
if { $argc != 3 } {
        send_user "Usage: \[ipAddress\],Port:\[mml_port\] cmd:\[ cmd_info\]\n"
        exit
}

set timeout 2

set ip [lindex $argv 0]
set Port [lindex $argv 1]
set cmdinfo [lindex $argv 2]

spawn /opt/huawei/snas/sbin/mml $ip $Port

expect "*mml>>>*"
send "$cmdinfo\r"

expect "*mml>>>*"
send "q\r"

expect eof
exit 0
