Last active
June 23, 2023 01:55
-
-
Save gbudny93/8ad0899576407e5efe9323febb368796 to your computer and use it in GitHub Desktop.
RouterOS_Function_Template.rsc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment