telnetѤ

telnetѤμưץȡ

#!/bin/sh
# ------------------------
#  telnet script
# ------------------------
# Version : 1.0
# update  : 2008/10/15

export LANG=C
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin

## Set

SERVER="192.168.1.1"

USER="username"
PASSWD="password"

COM="/tmp/telnet.cmd"
LOG="/var/log/telnet.log"

## Command
cat <<EOF > $COM
#!/bin/sh
sleep 5; echo $PASSWD
sleep 1; echo [command]
sleep 1; echo logout
EOF

## Exec
sh $COM | telnet -a -l $USER $SERVER >> $LOG 2>&1

## Exit
rm $COM

exit 0
#EOF

ȥå   Խ ʬ ʎގ̎ ź ʣ ̾ѹ   ǽ   إ   ǽRSS
Last-modified: 2008-10-15 () 15:45:42 (5615d)