hi
i want to ask if somevody can help me with simple script
this is what i want it to do
- mikrotik should load a web page
http://user:pass@192.168.1.1/wancfg.cmd?action=view
this will return a table in html with my external ip, so i need to cut that ip from other not interesting info and that ip write to variable for examlpe “actual_ip”. the html answer looks like this
<html><head>
<link rel=stylesheet href='stylemain.css' type='text/css'>
<link rel=stylesheet href='colors.css' type='text/css'>
<meta http-equiv='refresh' content='5'>
<meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
<title></title>
</head>
<body>
<blockquote>
<form>
<b>WAN informacie</b><br><br>
<table border='1' cellpadding='4' cellspacing='0'>
<tr align='center'>
<td class='hd'>Port/VPI/VCI</td>
<td class='hd'>VLAN Mux</td>
<td class='hd'>Con. ID</td>
<td class='hd'>Kategoria</td>
<td class='hd'>Sluzba</td>
<td class='hd'>Rozhranie</td>
<td class='hd'>Protokol</td>
<td class='hd'>Igmp</td>
<td class='hd'>QoS</td>
<td class='hd'>Rezim</td>
<td class='hd'>Stav</td>
<td class='hd'>IP adresa</td>
</tr>
<tr align='center'>
<td>0/1/32</td>
<td>Off</td>
<td>1</td>
<td>UBR</td>
<td>pppoe_0_1_32_1</td>
<td>ppp_0_1_32_1</td>
<td>PPPoE</td>
<td>Zakazat</td>
<td>Zakazat</td>
<td>Povolit</td>
<td>Up</td>
<td>1.1.1.1</td>
</tr>
</table>
</form>
</blockquote>
</body>
</html>
in this my external ip is 1.1.1.1
- create 2nd variable for example “previous_ip” with any value
now script will compare values of variables “actual_ip” and “previous_ip”
if they are NOT same, mikrotik will load another page
http://freedns.afraid.org/dynamic/update.php?123567890
and write “actual_ip” to “previous_ip”. or if they are same it wont load second page and after five minutes will start from beginning. only hard part is how to cut that ip
thats all