mirror of
https://github.com/gbudny93/RouterOS_Useful_Scripts.git
synced 2025-06-28 20:40:21 +02:00
Intial Commit. First Release
This commit is contained in:
parent
1508f05bc0
commit
e2280aad84
4 changed files with 50 additions and 0 deletions
|
@ -0,0 +1,2 @@
|
|||
:global n [file get value-name=name number=2]
|
||||
:if ($n ~ ".txt") do={/file remove $n} else={:put "No"}
|
|
@ -0,0 +1,27 @@
|
|||
# RouterOS Function
|
||||
# Copyright (c) Grzegorz Budny
|
||||
# Changes LCD mode based on time schedule
|
||||
|
||||
:global ChangeLcd do={
|
||||
|
||||
:local systemTime [/system clock get value-name=time];
|
||||
:local lcdMode [/lcd get color-scheme];
|
||||
|
||||
:local lightModeStart $lightModeStartTime;
|
||||
:local darkModeStart $darkModeStartTime;
|
||||
|
||||
:if ($systemTime = $lightModeStart && $lcdMode = "dark") do={
|
||||
|
||||
/lcd set color-scheme=light;
|
||||
/log info "..::Changed LCD mode to LIGHT::.."
|
||||
|
||||
}
|
||||
:if ($systemTime = $darkModeStart && $lcdMode = "light") do={
|
||||
|
||||
/lcd set color-scheme=light;
|
||||
/log info "..::Changed LCD mode to DARK::.."
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$ChangeLcd lightModeStartTime="08:00:00" darkModeStartTime="17:00:00";
|
|
@ -0,0 +1,21 @@
|
|||
# RouterOS Function
|
||||
# Copyright (c) Grzegorz Budny
|
||||
# Generates log alert when free disk space reach specified treshhold
|
||||
|
||||
:global LowDiskSpace do={
|
||||
|
||||
:local alertSpace $treshhold;
|
||||
|
||||
:local freeSpace [/system resource get free-hdd-space];
|
||||
:local totalSpace [/system resource get total-hdd-space];
|
||||
|
||||
:local diskUsage (($freeSpace * 100)/$totalSpace);
|
||||
|
||||
:if ($diskUsage < $treshhold) do={
|
||||
|
||||
/log warning ("Disk space reached ".$treshhold." % treshold. Free disk space is ".$diskUsage."%");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$LowDiskSpace treshhold=free_disk_space_in_%;
|
Loading…
Add table
Add a link
Reference in a new issue