mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-06-21 01:25:52 +02:00
global-functions: introduce $FileGet
This commit is contained in:
parent
4bc3bf40e6
commit
b70e6e7984
1 changed files with 13 additions and 0 deletions
|
@ -38,6 +38,7 @@
|
|||
:global ExitError;
|
||||
:global FetchHuge;
|
||||
:global FetchUserAgentStr;
|
||||
:global FileGet;
|
||||
:global FormatLine;
|
||||
:global FormatMultiLines;
|
||||
:global GetMacVendor;
|
||||
|
@ -529,6 +530,18 @@
|
|||
$Resource->"architecture-name" . " " . $Caller . "/Fetch (https://rsc.eworm.de/)");
|
||||
}
|
||||
|
||||
# get file properties in array, or false on error
|
||||
:set FileGet do={
|
||||
:local FileName [ :tostr $1 ];
|
||||
|
||||
:local FileVal false;
|
||||
:do {
|
||||
:set FileVal [ /file/get $FileName ];
|
||||
} on-error={ }
|
||||
|
||||
:return $FileVal;
|
||||
}
|
||||
|
||||
# format a line for output
|
||||
:set FormatLine do={
|
||||
:local Key [ :tostr $1 ];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue