|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
:global checkrun [/interface get WanDPPPOE run]
:if ($checkrun=false) do={
{/system scheduler enable "check interface Wandpppoe running"}
{/system scheduler disable "check_wand"}
} else={
:global reWanDAdd
:global curWanDAdd
:global curgw
:set reWanDAdd [/ip address get [/ip address find interface=WanDPPPOE] address]
:set curWanDAdd ([/ip fi nat get T6644 dst-address] . "/32")
:set curgw [/ip address get [/ip address find interface=WanDPPPOE] network]
:if ($reWanDAdd!=$curWanDAdd) do={
{/ip route set wandpppoe gate $curgw}
{/ip route set "benlang s_route" gate $curgw}
#{/system script run "ddns script"}
{/system script run "ddns_script2"}
{:set cport "T60021,T8899,T13050,U13050,T13005,U13005,T4709,U4709,T8000,U8001,U6501,T6500,T13001,T8821,T15190,U15190,U20715,U6654,T6644"
:set countportnumber [:len $cport]
:set i 0
:while ($i<$countportnumber) do={{:set ccport [:pick $cport $i]}
{/ip firewall nat set $ccport dst-address=$reWanDAdd}
{:set i ($i+1)}
}}
}
}
==========================================================================================
:global aaa
:set aaa [/interface get WanDPPPOE run]
:if ($aaa=false) do={:beep length=100ms frequency=2080} else={
{/system scheduler enable "check interface check_wand"}
{/system scheduler disable "check interface Wandpppoe running"}
{:set f "262,247,220,196,165,147,165,195,165,20000,262,247,247,220,196,165,165,165,220,196";:set d "500ms,500ms,250ms,500ms,750ms,500ms,500ms,500ms,1500ms,1000ms,500ms,250ms,250ms,500ms,250ms,750ms,500ms,250ms,1750ms,1500ms";:set i 0 ; :while ($i<20) do={:beep freq=([:pick $f $i ($i+1)]*2) len=[:pick $d $i ($i+1)];:delay [:pick $d $i ($i+1)];:set i ($i+1)}}
}
===================================================================================================
上面是两个脚本,我自己的定的是每30秒执行一次。本人脑袋最近有点僵硬,这两个脚本写了足足一个小时,累啊~~~希望给大家减少点脑力劳动,呵呵
[ 本帖最后由 cracks 于 2007-11-4 12:06 编辑 ] |
|