View Single Post
Old 05-12-2010, 15:00   #2281
treno2
Senior Member
 
L'Avatar di treno2
 
Iscritto dal: Oct 2004
Cittā: Via Emilia
Messaggi: 802
Ho modificato leggermente lo script, mettendo nelle prime righe utente, password e indirizzo del router.
quindi basta modificare la riga 2 e 3 per le proprie esigenze, e non toccare nulla sotto.

Codice:
@echo off
rem modificare qui sotto utnte password e indirizzo der router.
set my_access="admin:password"
set my_address=192.168.1.1
rem mon toccare nulla qui sotto.

if "%1" == "" goto error
set my_command="ping_size=$(%* 1>&2)"
curl -s -G -u %my_access% --data-urlencode "todo=ping_test" --data-urlencode "this_file=Diagnostics.htm" --data-urlencode "next_file=Ping.htm" --data-urlencode "c4_ping_ipaddr=%my_address%" --data-urlencode "ping_timeout=5000" --data-urlencode "ping_interval=1000" --data-urlencode "ping_number=1" --data-urlencode %my_command% http://%my_address%/setup.cgi | sed -e "/HTTP\/1.0 200 OK/q" -e "/<!DOCTYPE HTML PUBLIC/q"
goto end

:error
echo wag320n missing remote command
echo 	usage: wag320n [remote command]
echo 	example: wag320n /bin/ls -la /usr/sbin
echo 	Note: always use full path
echo 	wag320n - Ver. 1.0 - 12/09/2010
echo 	Licensed under GPL V. 3
:end
treno2 č offline   Rispondi citando il messaggio o parte di esso