欢迎光临
我们一直在努力

ROS外网拨号换IP自动发email邮箱范例

主要功能:

宽带拨号断线重拨以后,更换以后的新IP地址自动发送到邮箱;

:global pppoeip [/ip address get [find interface=”pppoe-out1″] address]

:global pppoeiptemp1 [ /ip pool get [find name=”temp1″] ranges]

:global tempnumber1 [:len $pppoeip]

:global tempnumber2 [pick $pppoeip 0 ($tempnumber1 – 3) ]

:if ($tempnumber2 = $pppoeiptemp1) do={} else={/ip pool set [find name=temp1] ranges=[$pppoeip]}

:global pooltemp1 [ /ip pool get [find name=”temp1″] ranges]

:global pooltemp2 [ /ip pool get [find name=”temp2″] ranges]

:if ($pooltemp1 = $pooltemp2) do={} else={/tool e-mail send to=xxxx@gmail.com subject=(“NEW-IP:  . [ /ip pool get [find name=”temp1″] ranges]) body=(“发送日期:” . [/system clock get date] . ” ;系统侦测时间:” . [/system clock get time]) tls=yes server=74.125.45.109}

:delay 3;

:if ($pooltemp1 = $pooltemp2) do={} else={/ip pool set [find name=temp2] ranges=[/ip address get [find interface=”pppoe-out1″] address]}
赞(0) 打赏
转载请注明出处:Ros资源网 » ROS外网拨号换IP自动发email邮箱范例

评论 抢沙发

评论前必须登录!

 

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏