shell 操作osgi

參考Login_osgi.sh腳本:

#/bin/bash
# Destription:Login osgi
# parameters: sh Login_osgi.sh
# Auther: xxxxx
# Date: 2015-5-15

function Login_osgi()
{
/usr/bin/expect <<\EOF
set timeout 60
set commod [lindex $argv 0]
#telnet本地的osgi 端口12501
spawn telnet localhost 12501
expect "osgi>"
send "$commod\n"
expect "osgi>"

#列舉bundle加載狀態
send "ss\n"
#退出osgi
send "disconnect\n"
#確認退出osgi
expect "Disconnect from console? (y/n; default=y)"
send "y\n"

expect eof
EOF
}
Login_osgi $@ 
exit 0 


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章