#!/bin/bash
if [ $# -lt 1 ]
then
echo "Usage : `basename $0` 10.35.46.89"
exit 1
fi
HOST=$1
UNAME=Administrator
PASSWD=PASSSW00RD
EXECCMD1='create /map1/accounts1 username=bestwiz password=linux_ccna name=bestwiz group=admin,config,oemhp_vm,oemhp_rc,oemhp_power'
expect -c "
set timeout 20
spawn telnet $HOST
expect \"Login Name:\" ; send \"$UNAME\r\"
expect Password:\ ; send \"$PASSWD\r\"
expect \">\" ; send \"$EXECCMD1\r\"
expect \">\" ; send \"exit\r\"
"
echo ""
阅读(924) | 评论(0) | 转发(0) |