ShellscriptForChangingProfileForDLinkRouter

ElegantCoder::wiki()

Elegantcoder (토론 | 기여) 사용자의 2009년 1월 16일 (금) 05:53 버전
(비교) ← 이전 판 | 현재 판 (비교) | 다음 판 → (비교)
 #!/bin/sh
routerId=admin
routerPasswd=
routerIp=192.168.0.1
fileName=$1
curl -s http://$routerIp/logout.htm > null
curl -s http://$routerIp/login.htm > null
curl -d uname=$routerId -d pws=$routerPasswd -s http://$routerIp/login.htm | grep -q -E "(function startUp|Internet Connection)" > null 
if [ "$?" == "0" ]
    then
    curl -o bsc_internet.htm -s http://$routerIp/bsc_internet.htm > null
    curl -o tools_system.htm -s http://$routerIp/tools_system.htm > null
    curl -s -o upload.htm -F CMD=SYS_CONF -F GO=tools_system.htm -F CCMD=3 -F files=@$fileName $routerIp/do_cmd.htm  > null
    exit 0
    else
        echo 실패
        exit 1
fi