somebody help me with the script please
- usermanager account expired
once disabled
sending email and sms to me and to them
with body: your accont $name is temporarily disconnected due to unpaid balance
then add his ip address to ip firewall list with comment under his account
after 30 days
of non payment
sending email to me and to them
body: your account $name is permanent disconnected.
{
:foreach ExpireUser in=[/tool user-manager user find where !actual-profile] do={
/tool user-manager user disable $ExpireUser;
}
}
:do {/tool user-manager users
:local LIST “Reminder”;
:foreach ix in=[find where ($sNAME)] 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
:do {/tool e-mail send to=“aaa@yahoo.com” subject=“$sNAME” body=“Temporary Disconnected” start-tls=yes}
:do {/tool e-mail send to=“$email” subject=“$sNAME” body=“Temporary Disconnected” start-tls=yes}
:do {/sms send to=“$sms” =“Your Account $sName is Temporary Disconnected”}
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…”}