|
发表于 2024-7-23 21:28:44
|
显示全部楼层
本帖最后由 47771885 于 2024-7-23 21:29 编辑
这个应该是差不多 十年前的脚本了,,看到了,那还是由我修复下吧
还是简单点 大于 7.10的版本设置 rosver 7 小于的设置为6
- {
- #www.routeros.cn 20220323
- :local nyr
- :local Year
- :local Month
- :local Day
- :local stime [/system clock get time]
- :local Date [/system clock get date]
- ##7.10 >v=7 v< 7.10 =6
- :local rosver 7
- :if ($rosver = 6) do={
- :set Year ([:pick $Date 7 11])
- :set Month ([:find jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec [:pick $Date 0 3]]+1)
- :if ($Month < 10) do={
- :set Month ("0" . $Month)
- }
- :set Day ([:pick $Date 4 6])
- :set nyr ($Year . $Month . $Day)
- } else={
- :set Year ([:pick $Date 0 4])
- :set Month ([:pick $Date 5 7])
- :set Day ([:pick $Date 8 10])
- :set nyr ($Year . $Month . $Day)
- }
- :local ii "0";
- /ppp secret;
- :foreach puse in [find disabled=no comment!="" comment!="admin"] do={
- :local pcom [get $puse comment];
- :local pnam [get $puse name];
- :set ii ($ii + 1)
- :if ([:len $pcom] >= 8) do={
- :local pcom8 [:tonum [:pick $pcom 0 8]];
- :if ($pcom8>1) do={
- :if ($nyr>=$pcom8) do={
- /ppp secret disable [/ppp secret find name=$pnam];:set ii ($ii-1);
- /ppp active remove [/ppp active find name=$pnam];
- :log error ("\BD\FB\D3\C3\D3\C3\BB\A7 [" . $pnam . "]");
- }} else={:log error ("\B4\ED\CE\F3\B5\C4\B1\B8\D7\A2\B8\F1\CA\BD [" . $pnam . "] [" . $pcom . "]");}
- } else={:log error ("\C8\D5\C6\DA\B1\B8\D7\A2\B2\BB\D7\E38\CE\BB [" . $pnam . "] [" . $pcom . "]")}}
- :log warning ("\D3\D0\D0\A7\D3\C3\BB\A7\CA\FD [" . $ii . "]");
- }
复制代码 |
|