mirror of
https://github.com/gbudny93/RouterOS_Useful_Scripts.git
synced 2025-07-14 20:24:29 +02:00
Initial Commit
This commit is contained in:
parent
fee1e16817
commit
1744ffa992
3 changed files with 61 additions and 0 deletions
18
RouterOS_Format_Drive.rsc
Normal file
18
RouterOS_Format_Drive.rsc
Normal file
|
@ -0,0 +1,18 @@
|
|||
# RouterOS Function
|
||||
# Copyright (c) Grzegorz Budny
|
||||
# Formats RouterOS additional drive
|
||||
|
||||
:global FormatDrive do={
|
||||
|
||||
:local driveLabel [/disk get number=$drive label];
|
||||
|
||||
:log warning ("...:::Drive ".$drive." ".$driveLabel." will be formatted!");
|
||||
|
||||
/disk eject-drive $drive;
|
||||
/disk format-drive $drive file-system=$fileSystem label=$label;
|
||||
|
||||
:log info ("...:::Drive ".$drive." has been formatted to ".$fileSystem." with label ".$label);
|
||||
|
||||
}
|
||||
|
||||
$FormatDrive drive=0 fileSystem=ext3 label=data;
|
20
RouterOS_R_ARP.rsc
Normal file
20
RouterOS_R_ARP.rsc
Normal file
|
@ -0,0 +1,20 @@
|
|||
# RouterOS Function
|
||||
# Copyright (c) Grzegorz Budny
|
||||
# ARP/RARP Function (shortange syntax)
|
||||
|
||||
:global R_ARP do={
|
||||
|
||||
:if ($mode="ARP") do={
|
||||
|
||||
:return [/ip arp print where mac-address=$ip];
|
||||
|
||||
}
|
||||
|
||||
:if ($mode="RARP") do={
|
||||
|
||||
:return [/ip arp print where mac-address=$mac];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$R_ARP mode=mode;
|
23
RouterOS_Substring_Variable.rsc
Normal file
23
RouterOS_Substring_Variable.rsc
Normal file
|
@ -0,0 +1,23 @@
|
|||
# RouterOS Function
|
||||
# Copyright (c) Grzegorz Budny
|
||||
# Substring variable
|
||||
|
||||
:global Subtring do={
|
||||
|
||||
:global substring;
|
||||
|
||||
:if ($findMode=true) do={
|
||||
|
||||
:set $substring [:pick $string [:find $string $signA] [:find $string $signB]];
|
||||
:return $substring;
|
||||
|
||||
}\
|
||||
else={
|
||||
|
||||
:set $substring [:pick $string $signA $signB];
|
||||
:return $substring;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$Substring findMode=true string="string" signA="A" signB "b";
|
Loading…
Add table
Add a link
Reference in a new issue