2019-07-13 23:38:40 +02:00
|
|
|
# RouterOS Function
|
|
|
|
# Copyright (c) Grzegorz Budny
|
|
|
|
# Creates directory in RouterOS
|
2019-04-29 22:55:33 +02:00
|
|
|
|
2019-07-13 23:38:40 +02:00
|
|
|
:global CreateDirecotry do={
|
2019-04-29 22:55:33 +02:00
|
|
|
|
2019-07-13 23:38:40 +02:00
|
|
|
:global userName;
|
|
|
|
:global password;
|
|
|
|
:global directoryName;
|
|
|
|
:global tempFileName temp.rsc;
|
2019-04-29 22:55:33 +02:00
|
|
|
|
2019-07-13 23:38:40 +02:00
|
|
|
/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;
|
2019-04-29 22:55:33 +02:00
|
|
|
|
2019-07-13 23:38:40 +02:00
|
|
|
/file remove ($directoryName."/".$tempFileName);
|
|
|
|
/file remove $tempFileName;
|
2019-04-29 22:55:33 +02:00
|
|
|
|
2019-07-13 23:38:40 +02:00
|
|
|
:log info ("New directory created - ".$directoryName);
|
2019-04-29 22:55:33 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-07-13 23:38:40 +02:00
|
|
|
$CreateDirecotry userName=UserName password=Password directoryName=DirectoryName;
|
2019-04-29 22:55:33 +02:00
|
|
|
|
|
|
|
|