Skip to content

Instantly share code, notes, and snippets.

@Winand
Created August 17, 2018 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Winand/731b91cd591e84fa585f5c4895578ca4 to your computer and use it in GitHub Desktop.
Save Winand/731b91cd591e84fa585f5c4895578ca4 to your computer and use it in GitHub Desktop.
mikrotik helper functions
local download do={
# Download file: [$download "src_url" "dst_file"] returns boolean
do {
/tool fetch $1 dst-path=$2
while ([len [/file find name=$2]] = 0) do={delay 0.1}
return true
} on-error={
return false
}
}
local abort do={
#Log error and exit script
log error $1
error $1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment