ROS脚本-下线时判断在线数量进行重拨号

脚本放在/ppp profile down-script里,对下线用户执行动作脚本

下线统计用户在线,条件合适重拨线路 (在线为192.168.3x.xx段的IP)

{
:local dy
:local vpnip
:local pingip
:local oncount
:set vpnip $"remote-address"
:set vpnip [:pick $vpnip 11 [:len $vpnip]]
:set pingip [("pppoe-out" .$vpnip)]
:set oncount [:len [/ppp active find address~"^192.168.3*.\\.$vpnip\$"]]
:set dy "/interface pppoe-client enable $pingip"
:if ($oncount=0) do={
:log error message="$dy"
:execute $dy
:execute $dy
} else={
:log error message="$vpnip:$oncount"
}
}

 

posted @ 2021-10-08 13:33  嗷嗷鹿鸣[VX|dshoub]  阅读(238)  评论(0编辑  收藏  举报