{
:local wifiprofile wifi_security_profile
:local toEmail yourmail@domain.com
:local time [:pick [/system clock get time] 0 2];
:local min [:pick [/system clock get time] 3 5];
:local sec [:pick [/system clock get time] 6 8];
:local char;
:set char ( $char . [ :pick $time 1 ] . [ :pick $time 0 ]);
:local char1;
:set char1 ( $char1 . [ :pick $min 1 ] . [ :pick $min 0 ]);
:local char2;
:set char2 ( $char2 . [ :pick $sec 1 ] . [ :pick $sec 0 ]);
:local arrayalpha ("2","C","h","Y","!","f","j","c","}","q","k",":","(","}","3","Y","T","|","C","v","}","n","8","I","r","4","p","V","6",":","S","V","=","p","Z","T","6",")","l",":","K","b","=","Y","7","X","c","P","@","g","m","U","T","_","g","v","N","j","E","g","f","D","h","!","W","p","U","z","T","S","}","h","M","Y","i","E","c","4","!","Q","(","<","Y","h","@","e","q","7","]","l","R","-","h","S","w","(",">","/","r","=","<","I","&","5","@","!","|","h","p","l","1","Y","U","2","J","R","T","Y","}","=","b","c","$","9","d","e","@","S","6","W","B","Q","$","S","b","p","}","3","m","X","g","8","y","j","h","S","Z","F","@","!","t","}","!","U","j","/","W","5","}","a","g","!","S","S","T","{","7","f","G","W","T","_","/","k","3","+","T","X","p","m","!","e","i","L","]","3","d","G","T","+","@","H","!","Q","k","X","@","P","Q","+","k","f","K","T","S","{","Q","W","S","<","S","z","z","k","V","@","X","{","4","g","t","X","1","h","5","k","T","_","f","i","{","]","(","Y","/","1","j","h","l","]","S","3","b","Y",":","i","T","j","h","T","7","w","g","D","X","g","T","T","i","|","S","R","!","}","D","d","c","h","d","T","l","N",")","V","u","Z","T","}",":","{","S","m","Z","d","}","Z","Z","S","Y","|","_","d","k","v","h","(","7","/","-");
:local new;
:set new ( $new . [ :pick $arrayalpha ($time+$min+$sec) ] . [ :pick $arrayalpha ($time+$sec) ] . [ :pick $arrayalpha ($min+$sec) ] . [ :pick $arrayalpha $sec ] . [ :pick $arrayalpha $char ] . [ :pick $arrayalpha $char1 ] . [ :pick $arrayalpha $char2 ] . [ :pick $arrayalpha ($char+$char1+$char2) ]);
:local arrlengh [:len $arrayalpha];
:put "Our Array Lengh is $arrlengh Your New String is $new";
}
{
/tool fetch url="https://www.random.org/passwords/\?num=1&len=8&format=plain&rnd=new" keep-result=yes dst-path="pass.txt"
:local pass [/file get pass.txt contents]
:put $pass
}
{
local pass ([/tool fetch url="https://www.random.org/passwords/\?num=1&len=20&format=plain&rnd=new" output=user as-value]->"data")
:put $pass
}
local pass ([/tool fetch url="https://www.random.org/passwords/\?num=1&len=20&format=plain&rnd=new" output=user as-value]->"data")
:put $pass
# Set your wifi profile
:local wifiprofile set_your_profile
# Set your email
:local toEmail my.emai@gmail.com
# Gets a new password
:local new ([/tool fetch url="https://www.random.org/passwords/\?num=1&len=20&format=plain&rnd=new" output=user as-value]->"data")
# Set password to wifi profile
:interface wireless security-profiles set $wifiprofile wpa-pre-shared-key="$new"
:interface wireless security-profiles set $wifiprofile wpa2-pre-shared-key="$new"
# Send email
:tool e-mail send to=$toEmail subject="$[/system identity get name] WiFi Password" body="This Week's Wireless Password Is: $new"
# Write a log line
:log info message="Wifi password for profile $wifiprofile has ben set to $new"
{
:local new ([/tool fetch url="https://www.random.org/passwords/\?num=1&len=20&format=plain&rnd=new" output=user as-value]->"data")
:put $new
}
:interface wireless security-profiles print
:interface wireless security-profiles set your_profile wpa2-pre-shared-key="test"
{
:local new ([/tool fetch url="https://www.random.org/passwords/\?num=1&len=20&format=plain&rnd=new" output=user as-value]->"data")
:interface wireless security-profiles set your_profile wpa2-pre-shared-key="$new"
}
how can i combine all together?Then try
to get then name of your profile.Code: Select all:interface wireless security-profiles print
Then run after change your_profile to your profileDoes this work?Code: Select all:interface wireless security-profiles set your_profile wpa2-pre-shared-key="test"
YES it does work,any pass i put will change to test
NB I do not have Wifi device so need to take on test at a time.
If all above work try to cut and past this (aftter change to your_profileCode: Select all{ :local new ([/tool fetch url="https://www.random.org/passwords/\?num=1&len=20&format=plain&rnd=new" output=user as-value]->"data") :interface wireless security-profiles set your_profile wpa2-pre-shared-key="$new" }
:local test 123
:put $test
{
:local test 123
:put $test
}
Its more or less the same as I wrote above. Use code tags around your script. Select code and click the </> button.
please give me an example?
:put $pass
is not needed.
You need to create a schedule for it to run weekly.
len=20
len=5
{
your code
}
https://www.random.org/passwords/\?num=1&len=20&format=plain&rnd=new
{
:local new ([/certificate scep-server otp generate minutes-valid=0 as-value]->"password")
:interface wireless security-profiles set your_profile wpa2-pre-shared-key="$new"
}
:local $weeknumber=(calculate weeknumber[1-52]);
set scriptname interval=(7d - $weeknumber)
:local wifiprofile "You wireless security-profiles name"
# "len=" in the url it is the number of characters for in the generated password
/tool fetch url="https://www.random.org/passwords/\?num=1&len=10&format=plain&rnd=new" keep-result=yes dst-path="pass.txt"
delay 3
# The last digit before the closing square bracket must be "len=" from url
:local newPassword [put [pick ([/file get [/file find name=pass.txt] contents]) 0 10]];
:interface wireless security-profiles set $wifiprofile wpa-pre-shared-key="$newPassword";
:interface wireless security-profiles set $wifiprofile wpa2-pre-shared-key="$newPassword";
/file remove [find name="pass.txt"];
/log info message="New Wi-Fi Pass = $newPassword"