how to disable comment from 1 to 720
i create the script but its not working.
:if ($Comment=1-720) do={
: log info " the user: $User has Temporary Disconnected!"
[ /ppp secret disable $i ]
[ /ppp active remove [find name=$User] ]
.
:do {/ppp secret
:foreach ix in=[find where (comment>"0" && comment<"721")] do={
:local sNAME [get $ix name];
disable $ix;
:log warning message=("The user: " . $sNAME . " has Temporary Disconnected!");
:do {/ppp active remove numbers=[find where name=$sNAME]
} on-error={:log error message=("Disconnecting " . $sNAME . " Failed");}
}
} on-error={:log error message="script failed..."}
after i run the script sir all my users were disable even there is no comment attached on thier namewow thats great but i have problem in the script sir
all of my users where remove after the script is run
i tried it sir but the problem is even the comment is not 0 the remote ip is still there.try with
:do {/ppp secret
:local LIST "reminder";
:foreach ix in=[find where comment="0"] do={
:local sNAME [get $ix name];
:if ([/ppp active find where name=$sNAME]!="") do={
:local IPadd [/ppp active get number=[find where name=$sNAME] address];
:do {/ip firewall address-list
add list=$LIST address=$IPadd comment=$sNAME
} on-error={:log error message=("move address of " . $sNAME . " to address-list failed, maybe exist")}
}
}
} on-error={:log error message="script failed..."}
I'm looking for PHP web designerNo I am not
sir one more pleasethank you sir its working now. so helpful. thank you very very very very much
/ppp secret disable [find where comment>="1" and comment<="720"]
1. @ADahi sir is it possible to update only 1ip in firewall addresslist under the comment name coming from ppp secret from his latest ip address@runbound
updated check it again
:do {/ppp secret
:local LIST "reminder";
:foreach ix in=[find where comment="0"] do={
:local sNAME [get $ix name];
:if ([/ppp active find where name=$sNAME]!="") do={
:local IPadd [/ppp active get number=[find where name=$sNAME] address];
:do {/ip firewall address-list
remove numbers=[find where comment=$sNAME && list=$LIST];
add list=$LIST address=$IPadd comment=$sNAME;
} on-error={:log error message=("move address of " . $sNAME . " to address-list failed")}
}
}
} on-error={:log error message="script failed..."}