mirror of
https://github.com/gbudny93/RouterOS_Useful_Scripts.git
synced 2025-06-23 02:08:43 +02:00
25 lines
664 B
Text
25 lines
664 B
Text
# RouterOS Function
|
|
# Copyright (c) Grzegorz Budny
|
|
# Creates directory in RouterOS
|
|
|
|
:global CreateDirecotry do={
|
|
|
|
:global userName;
|
|
:global password;
|
|
:global directoryName;
|
|
:global tempFileName temp.rsc;
|
|
|
|
/system identity export file=$tempFileName;
|
|
/tool fetch address=127.0.0.1 src-path=$tempFileName user=$userName password=$password \
|
|
dst-path=($directoryName."/".$tempFileName) mode=ftp port=21;
|
|
|
|
/file remove ($directoryName."/".$tempFileName);
|
|
/file remove $tempFileName;
|
|
|
|
:log info ("New directory created - ".$directoryName);
|
|
|
|
}
|
|
|
|
$CreateDirecotry userName=UserName password=Password directoryName=DirectoryName;
|
|
|
|
|