gbudny93.RouterOS_Useful_Sc.../RouterOS_Create_Directory.rsc

28 lines
703 B
Text
Raw Normal View History

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