Skip to content

A Simple mkdir function for Mikrotik devices

License

Notifications You must be signed in to change notification settings

hatamiarash7/Mikrotik-Mkdir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mikrotik-Mkdir

A script that creates a $mkdir global function. You will be able to create folders on your Mikrotik device by :

$mkdir some/new/path.

Installation

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;
}

Usage

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.

Example

For example you can use this function to create a backups directory :

:global mkdir;
$mkdir "backups";
/system backup save name=backups/2021-04-02;

Support

Donate with Bitcoin Donate with Ethereum

ko-fi

Contributing

  1. Fork it !
  2. Create your feature branch : git checkout -b my-new-feature
  3. Commit your changes : git commit -am 'Add some feature'
  4. Push to the branch : git push origin my-new-feature
  5. Submit a pull request :D

Issues

Each project may have many problems. Contributing to the better development of this project by reporting them.