I want to write a script like this
Code: Select all
if ($myRouterHasWlan = true) {run this}
else {run that}
if ($myRouterHasWlan = true) {run this}
else {run that}
# Check that if we're using a wireless LAN
:if ($usewlan = "yes") do={
# Check that the WAN interface exists
:if ([/interface find name=$waninterface] = "") do={
{
local wlan [len [interface wireless find]]
if ($wlan>0) do={/system script run script1} else={/system script run script2}
}
:if ($usewlan = "no") do={/file set nuova.txt contents="no wireless"}
{
local wlan [len [interface wireless find]]
if ($wlan<1) do={/file set nuova.txt contents="no wireless"}
}
{
local wlan [len [interface wireless find]]
if ($wlan<1) do={/file set nuova.txt contents="no wireless"}
}
put [file get nuova.txt contents ]
file print file=nuova.txt
put [file get nuova.txt contents ]
{
local wlan [len [interface wireless find]]
if ($wlan<1) do={/file set nuova.txt contents="no wireless"}
}
put [file get nuova.txt contents ]