Thanks will give them try tomorrow to let you know I feel like with this code am get closed to what i want to do
maybe I should probably try the script use the sn vs mac address just to test that I was testing on a virtual machine so it did not have sn to use
now test on hap ac as said the script fun fine pasted into the cli terminal window but it doesn't run as import script or system script I am going try it maybe I cant use fetch in system script seem odd would have figured that script should have work in both system script and cli if was go to work
sorry i am set the mac via script
#/interface ethernet get ether1 mac-address
:log info "ethernet-mac-to-viable"
:global macaddress [/interface ethernet get ether1 mac-address]
and this does work at cli to fetch the file
I think its the else that makes problem.
Can not see in your script that you have set the macaddress. All variables needs to be set or declared.
Do not use global variable if you do not need it. Only when passing data from one script to another or store the variable for later use.
Even then you need to declare the global variable before use.
{
:local macaddress xx.xx.xx.xx
:local configserver "http://192.168.1.187/$macaddress/temp.rsc"
:local provisionedstatus false
:if $provisionedstatus do={/tool fetch url=$configserver output=file; :log info "download provision"}
}
Or
{
:local macaddress xx.xx.xx.xx
:local configserver "http://192.168.1.187/$macaddress/temp.rsc"
:local provisionedstatus false
:if ($provisionedstatus=true) do={/tool fetch url=$configserver output=file; :log info "download provision"}
}
Or
{
:local macaddress xx.xx.xx.xx
:local configserver "http://192.168.1.187/$macaddress/temp.rsc"
:local provisionedstatus false
:if ($provisionedstatus=false) do={/tool fetch url=$configserver output=file; :log info "download provision"}
}