-
Notifications
You must be signed in to change notification settings - Fork 26
/
RouterOS_Function_Template.rsc
37 lines (28 loc) · 1.17 KB
/
RouterOS_Function_Template.rsc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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;