sylvain_27
28/08/2004, 10h47
Salut,
J'ai écrit un script qui récupère l'adresse IP sur un routeur D-link 504T.
Ce routeur à une interface d'administration web, mais l'identification n'est pas de type Basic. On ne peut pas le consulter avec Bali DynDns. :(
J'ai donc bricolé un script sous Linux qui fait le travail et modifié le script d'OVH pour la mise à jour.
#!/bin/bash
# Author: Sylvain Viart <sylvain (at) ledragon.net>
# For D-Link 504T router
# this script return the current IP
# the admin user and password are coded in the file post.txt
ROUTER_ADD=10.0.1.1
wget -q -O - \
--post-file post.txt \
"http://${ROUTER_ADD}/cgi-bin/webcm" | \
sed -n -e '/<td height.*[0-9]\+\./ s/.*">\([0-9.]\+\).*/\1/ p'
# example of post.txt file in ONE line !
# change LOGIN_HERE and PASSWORD_HERE for your ovh account information
# getpage=../html/status/connstatus.htm&errorpage=../html/index.html&var:errorms
g=Error&login:command/username=LOGIN_HERE&login:command/password=PASSWORD_HERE
Contactez moi si vous voulez plus de détails.
Cordialement,
Sylvain.
J'ai écrit un script qui récupère l'adresse IP sur un routeur D-link 504T.
Ce routeur à une interface d'administration web, mais l'identification n'est pas de type Basic. On ne peut pas le consulter avec Bali DynDns. :(
J'ai donc bricolé un script sous Linux qui fait le travail et modifié le script d'OVH pour la mise à jour.
#!/bin/bash
# Author: Sylvain Viart <sylvain (at) ledragon.net>
# For D-Link 504T router
# this script return the current IP
# the admin user and password are coded in the file post.txt
ROUTER_ADD=10.0.1.1
wget -q -O - \
--post-file post.txt \
"http://${ROUTER_ADD}/cgi-bin/webcm" | \
sed -n -e '/<td height.*[0-9]\+\./ s/.*">\([0-9.]\+\).*/\1/ p'
# example of post.txt file in ONE line !
# change LOGIN_HERE and PASSWORD_HERE for your ovh account information
# getpage=../html/status/connstatus.htm&errorpage=../html/index.html&var:errorms
g=Error&login:command/username=LOGIN_HERE&login:command/password=PASSWORD_HERE
Contactez moi si vous voulez plus de détails.
Cordialement,
Sylvain.