Примеры скриптов для прошивки DIR-320 Печать
28.03.11 15:56

Примеры скриптов для прошивки DIR-320

 

Вариант скрипта для Windows XP

@echo off
echo ==============================
=============================================
echo This batch file will upload dd-wrt firmware in the current directory to
echo 192.168.0.1 during the router's bootup.
echo.
echo * Set your ethernet card's settings to:
echo IP: 192.168.0.100
echo Mask: 255.255.255.0
echo Gateway: 192.168.0.1
echo * Unplug the router's power cable.
echo.

echo Press Ctrl+C to abort or any other key to continue...
pause > nul

echo.
echo * Re-plug the router's power cable.
echo.
echo ===============================================
echo Waiting for the router... Press Ctrl+C to abort.
echo.

set FIND=%WINDIR%\command\find.exe
if exist %FIND% goto PING
set FIND=%WINDIR%\system32\find.exe
if exist %FIND% goto PING
set FIND=find

:PING

ping -n 1 -w 50 192.168.0.1 | %FIND% "TTL="
if errorlevel 1 goto PING

echo *** Start Flashing ****
tftp -i 192.168.0.1 put firmware.bin
if errorlevel 1 goto PING

set FIND=

echo.

echo ================================================
echo * WAIT for about 2 minutes while the firmware is being flashed.
echo * Reset your ethernet card's settings back to DHCP.
echo * The default router address will be at 192.168.0.1
echo.

pause

 

Упрощенный вариант для Windows XP

@Echo Off
:BEGIN
ping -n 1 -w 1 192.168.0.1
If errorlevel 1 Goto BEGIN
If errorlevel 0 Goto FLASH
Goto END

:FLASH
Echo *** Start Flashing ****
tftp -i 192.168.0.1 put firmware.bin

:END


 

Вариант скрипта для Linux

$ cd /path/to/firmware.bin/
directory
$ tftp
tftp> binary
tftp> trace
tftp> rexmt 1
tftp> connect 192.168.0.1
tftp> put firmware.bin

 

{jcomments on}

Последнее обновление 28.03.11 16:12