mirror of
https://github.com/gbudny93/RouterOS_Useful_Scripts.git
synced 2025-06-21 09:35:43 +02:00
24 lines
520 B
Text
24 lines
520 B
Text
|
# RouterOS Function
|
||
|
# Copyright (c) Grzegorz Budny
|
||
|
# Loads function to RouterOS environment
|
||
|
|
||
|
:global LoadScript do={
|
||
|
|
||
|
|
||
|
:if ([:len [/file find name=$scriptName]] <= 0) do={
|
||
|
:log info ($scriptName." not found, make sure file exists!");
|
||
|
}
|
||
|
|
||
|
:if ([:len [/file find name=$scriptName]] > 0) do={
|
||
|
:log info ($scriptName." found. Executing!");
|
||
|
/system script run $scriptName;
|
||
|
:log info ($scriptName." loaded to environment");
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
$LoadScript scriptName=testScript.rsc;
|
||
|
|
||
|
|
||
|
|