Created
August 17, 2018 19:07
-
-
Save Winand/731b91cd591e84fa585f5c4895578ca4 to your computer and use it in GitHub Desktop.
mikrotik helper functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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