mirror of
https://github.com/gbudny93/RouterOS_Useful_Scripts.git
synced 2025-06-26 19:58:41 +02:00
Initial Commit.
This commit is contained in:
parent
8cacc24150
commit
ff04ad34f2
4 changed files with 110 additions and 0 deletions
37
RouterOS_Function_Template.rsc
Normal file
37
RouterOS_Function_Template.rsc
Normal file
|
@ -0,0 +1,37 @@
|
|||
# RouterOS Function/Script
|
||||
# Copyright (c) Grzegorz Budny
|
||||
# Version 1.0
|
||||
# Last update: 2/8/2020
|
||||
# Description of this what script/function does
|
||||
|
||||
# Function definition
|
||||
:global RouterOS_Function do={
|
||||
|
||||
# DEFINITIONS
|
||||
# Getters section
|
||||
# Global variables definition - split out defined and undefined variables during declaring
|
||||
:global globalDefinedVariable [/system identity get value-name=name];
|
||||
:global globalDefinedVariable2 [/system identity get value-name=name];
|
||||
|
||||
:global globalUndefinedVariable;
|
||||
:global globalUndefinedVariable2;
|
||||
|
||||
# Local variables definition - split out defined and undefined variables during declaring
|
||||
:local localDefinedVariable [/system identity get value-name=name];
|
||||
:local localDefinedVariable2 [/system identity get value-name=name];
|
||||
|
||||
:local localUndefinedVariable;
|
||||
:local localUndefinedVariable2;
|
||||
|
||||
# Setters section
|
||||
:set $globalUndefinedVariable [/system identity get value-name=name];
|
||||
:set $localUndefinedVariable [:toarray $localUndefinedVariable];
|
||||
|
||||
# MAIN SCRIPT
|
||||
:log info ("This is my script with ".$localDefinedVariable2."\n");
|
||||
/system reboot;
|
||||
|
||||
}
|
||||
|
||||
# Example
|
||||
RouterOS_Function functionParameter=parameterDefinition;
|
Loading…
Add table
Add a link
Reference in a new issue