I finally got to complete my script thanks to al3xeezer.
This will change your wifi hotspot password based on months.
checks current wifi hotspot password, if true this will not proceed on sending an email report and will not change your password.
if false the script will send the new password into your email and will change the wifi hotspot password based on what month you’re in right now.
just add a scheduler to run this script perfectly
:local date [/system clock get date];
:local months {jan="africa";feb="brazil";mar="canada";apr="denmark";may="egypt";jun="france";jul="germany";aug="holland";sep="india";oct="japan";nov="kenya";dec="laos"};
if ([:typeof ($months->[:pick $date 0 3])] != "nothing") do={ :global newPassword ($months->[:pick $date 0 3]);
:local currentPass [/ip hotspot user get bayfront password];
:if ($currentPass = $newPassword) do={
:log info ("Its not time yet to change to ". $currentPass);} else={
:log info ("Monthly wifi hotspot password changed to: ".$newPassword)
/ip hotspot user set bayfront password="$newPassword";
/tool e-mail send to=your@email.com subject= ([/system identity get name] . " WiFi Password Changed " . \
[/system clock get date]) body="Bayfront Hotel Cebu Wifi Hotspot Password was Changed to $newPassword
This is a system generated e-mail, sent from Mikrotik RouterOS.
Thank you,
Rey Austine Echavez
Bayfront Hotel Cebu - IT"
}}