Prisijungimas prie telnet ir komandu vykdymas

Iš Žinynas.
Jump to navigation Jump to search

Prisijungiam prie windows serverio ir paziurim jo uptime

#!/bin/sh
host=192.168.1.101
port=23
user=admin
pass=passwordas
( sleep 1
 echo "${user}\r"
 sleep 1
 echo "${pass}\r"
 sleep 2
 echo "systeminfo | find \"Up Time\"\r"
 sleep 10
 echo "exit" ) | telnet ${host} ${port}