sh autoftp

카테고리 없음 2015. 4. 23. 17:15

$ cat autoftp.sh

#! /bin/sh

ftp -i -n 123.45.67.89 << ENDOFFTP

user user1234 password5678

hash

put $1

bye

ENDOFFTP

echo " TO ftpserver, PUT file $1 ";


windows 에서 telnet 을 이용한 http server 자동 테스트.
test.vbs 로 저장한 뒤 더블클릭(또는 윈도 배치(시작프로그램 등)에 등록)



set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "cmd"
WScript.Sleep 100
WshShell.AppActivate "C:\Windows\system32\cmd.exe"
WScript.Sleep 100
WshShell.SendKeys "telnet yahoo.com 80{ENTER}"
WScript.Sleep 2000
WshShell.SendKeys "GET /index.html{ENTER}"
WshShell.SendKeys "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4{ENTER}"
WshShell.SendKeys "Host: yahoo.com{ENTER}"
WshShell.SendKeys "{ENTER}"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 2000
WshShell.SendKeys "exit{ENTER}" 'close cmd.exit