A script that creates a $mkdir
global function. You will be able to create folders on your Mikrotik device by :
$mkdir some/new/path.
Upload mkdir_function.rsc
to your device and run :
/import mkdir_function.rsc
Or simply run this command in terminal :
{
:local result [/tool fetch \
url="https://raw.githubusercontent.com/hatamiarash7/Mikrotik-Mkdir/main/mkdir_function.rsc" \
as-value output=user];
:local script [:parse ($result->"data")]
$script;
}
First, you must have a :global mkdir;
declaration at the top of your script in order to use $mkdir
.
On the command line, simply type $mkdir your/path
, and the entire folder tree will be created. If the path already exists, the function quits.
For example you can use this function to create a backups
directory :
:global mkdir;
$mkdir "backups";
/system backup save name=backups/2021-04-02;
- Fork it !
- Create your feature branch :
git checkout -b my-new-feature
- Commit your changes :
git commit -am 'Add some feature'
- Push to the branch :
git push origin my-new-feature
- Submit a pull request :D
Each project may have many problems. Contributing to the better development of this project by reporting them.