Derrière un proxy
Voici un petit script unix qui fait l'affaire: il récupère l'ip via le script getip, et met à jour l'IP si besoin.
#!/bin/bash
export old_ip=`cat /tmp/my_ip`
export ip=`curl -s http://rrdata.free.fr/getip.php`
if [ "$old_ip" != "$ip" ] ; then
fi
le script getip.php est tout simplement:
<?php
echo getenv("REMOTE_ADDR");
?>
Dans la crontab, on fait le test toutes les demi-heures:
0,30 * * * * /path/to/updatescript.sh