disable rules by comment

To answer your first question, why not simply use?

/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
  2. how can i send one time mail to my email and to my client email address
    i have to email the client 3 days before the comment becomes 0

:do {/ppp secret
:local LIST “Reminder_Customer”;
:foreach ix in=[find where (comment>“-30” && comment<“0”)] do={
:local sNAME [get $ix name];
:if ([/ppp active find where name=$sNAME]!=“”) do={
:do {/tool e-mail send to=“xxx@yahoo.com” subject=“$sNAME” body=“Temporary Disconnected” start-tls=yes}
: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…”}
baracuda.png

@runbound
You are going to make things complicated, I recommend you use RADIUS

@ADahi
thanks sir how about question1 sir can u help me with that to work

you welcome

: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..."}

thank u very much for the time you gave to me sir. i so much appreciated. do you have email sir if i have offer for u

I know you’d do the same for me. :wink:

sir @ADahi can you help me again
remember the comment sir from 30 down to 0 and its moving according to my script.
how to add the name TEMP beside those numbers where numbers is moving

i try to add temp in comment but the problem is the numbers in comment not moving anymore