脚本放在/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" } }