-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename scripts and add file extension ".rsc"
No functional change for the user... The migration is done automatically.
- Loading branch information
Showing
125 changed files
with
5,622 additions
and
5,175 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,3 @@ | ||
#!rsc by RouterOS | ||
# RouterOS script: accesslist-duplicates.capsman | ||
# Copyright (c) 2018-2023 Christian Hesse <mail@eworm.de> | ||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md | ||
# | ||
# print duplicate antries in wireless access list | ||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/accesslist-duplicates.md | ||
# | ||
# !! Do not edit this file, it is generated from template! | ||
|
||
:local 0 "accesslist-duplicates.capsman"; | ||
:global GlobalFunctionsReady; | ||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; } | ||
|
||
:global Read; | ||
|
||
:local Seen ({}); | ||
:local Shown ({}); | ||
|
||
:foreach AccList in=[ /caps-man/access-list/find where mac-address!="00:00:00:00:00:00" ] do={ | ||
:local Mac [ /caps-man/access-list/get $AccList mac-address ]; | ||
:foreach SeenMac in=$Seen do={ | ||
:if ($SeenMac = $Mac) do={ | ||
:local Skip 0; | ||
:foreach ShownMac in=$Shown do={ | ||
:if ($ShownMac = $Mac) do={ :set Skip 1; } | ||
} | ||
:if ($Skip = 0) do={ | ||
/caps-man/access-list/print where mac-address=$Mac; | ||
:set Shown ($Shown, $Mac); | ||
|
||
:put "\nNumeric id to remove, any key to skip!"; | ||
:local Remove [ :tonum [ $Read ] ]; | ||
:if ([ :typeof $Remove ] = "num") do={ | ||
:put ("Removing numeric id " . $Remove . "...\n"); | ||
/caps-man/access-list/remove $Remove; | ||
} | ||
} | ||
} | ||
} | ||
:set Seen ($Seen, $Mac); | ||
} | ||
# dummy for migration |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!rsc by RouterOS | ||
# RouterOS script: accesslist-duplicates.capsman | ||
# Copyright (c) 2018-2023 Christian Hesse <mail@eworm.de> | ||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md | ||
# | ||
# print duplicate antries in wireless access list | ||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/accesslist-duplicates.md | ||
# | ||
# !! Do not edit this file, it is generated from template! | ||
|
||
:local 0 "accesslist-duplicates.capsman"; | ||
:global GlobalFunctionsReady; | ||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; } | ||
|
||
:global Read; | ||
|
||
:local Seen ({}); | ||
:local Shown ({}); | ||
|
||
:foreach AccList in=[ /caps-man/access-list/find where mac-address!="00:00:00:00:00:00" ] do={ | ||
:local Mac [ /caps-man/access-list/get $AccList mac-address ]; | ||
:foreach SeenMac in=$Seen do={ | ||
:if ($SeenMac = $Mac) do={ | ||
:local Skip 0; | ||
:foreach ShownMac in=$Shown do={ | ||
:if ($ShownMac = $Mac) do={ :set Skip 1; } | ||
} | ||
:if ($Skip = 0) do={ | ||
/caps-man/access-list/print where mac-address=$Mac; | ||
:set Shown ($Shown, $Mac); | ||
|
||
:put "\nNumeric id to remove, any key to skip!"; | ||
:local Remove [ :tonum [ $Read ] ]; | ||
:if ([ :typeof $Remove ] = "num") do={ | ||
:put ("Removing numeric id " . $Remove . "...\n"); | ||
/caps-man/access-list/remove $Remove; | ||
} | ||
} | ||
} | ||
} | ||
:set Seen ($Seen, $Mac); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,3 @@ | ||
#!rsc by RouterOS | ||
# RouterOS script: accesslist-duplicates.local | ||
# Copyright (c) 2018-2023 Christian Hesse <mail@eworm.de> | ||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md | ||
# | ||
# print duplicate antries in wireless access list | ||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/accesslist-duplicates.md | ||
# | ||
# !! Do not edit this file, it is generated from template! | ||
|
||
:local 0 "accesslist-duplicates.local"; | ||
:global GlobalFunctionsReady; | ||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; } | ||
|
||
:global Read; | ||
|
||
:local Seen ({}); | ||
:local Shown ({}); | ||
|
||
:foreach AccList in=[ /interface/wireless/access-list/find where mac-address!="00:00:00:00:00:00" ] do={ | ||
:local Mac [ /interface/wireless/access-list/get $AccList mac-address ]; | ||
:foreach SeenMac in=$Seen do={ | ||
:if ($SeenMac = $Mac) do={ | ||
:local Skip 0; | ||
:foreach ShownMac in=$Shown do={ | ||
:if ($ShownMac = $Mac) do={ :set Skip 1; } | ||
} | ||
:if ($Skip = 0) do={ | ||
/interface/wireless/access-list/print where mac-address=$Mac; | ||
:set Shown ($Shown, $Mac); | ||
|
||
:put "\nNumeric id to remove, any key to skip!"; | ||
:local Remove [ :tonum [ $Read ] ]; | ||
:if ([ :typeof $Remove ] = "num") do={ | ||
:put ("Removing numeric id " . $Remove . "...\n"); | ||
/interface/wireless/access-list/remove $Remove; | ||
} | ||
} | ||
} | ||
} | ||
:set Seen ($Seen, $Mac); | ||
} | ||
# dummy for migration |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!rsc by RouterOS | ||
# RouterOS script: accesslist-duplicates.local | ||
# Copyright (c) 2018-2023 Christian Hesse <mail@eworm.de> | ||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md | ||
# | ||
# print duplicate antries in wireless access list | ||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/accesslist-duplicates.md | ||
# | ||
# !! Do not edit this file, it is generated from template! | ||
|
||
:local 0 "accesslist-duplicates.local"; | ||
:global GlobalFunctionsReady; | ||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; } | ||
|
||
:global Read; | ||
|
||
:local Seen ({}); | ||
:local Shown ({}); | ||
|
||
:foreach AccList in=[ /interface/wireless/access-list/find where mac-address!="00:00:00:00:00:00" ] do={ | ||
:local Mac [ /interface/wireless/access-list/get $AccList mac-address ]; | ||
:foreach SeenMac in=$Seen do={ | ||
:if ($SeenMac = $Mac) do={ | ||
:local Skip 0; | ||
:foreach ShownMac in=$Shown do={ | ||
:if ($ShownMac = $Mac) do={ :set Skip 1; } | ||
} | ||
:if ($Skip = 0) do={ | ||
/interface/wireless/access-list/print where mac-address=$Mac; | ||
:set Shown ($Shown, $Mac); | ||
|
||
:put "\nNumeric id to remove, any key to skip!"; | ||
:local Remove [ :tonum [ $Read ] ]; | ||
:if ([ :typeof $Remove ] = "num") do={ | ||
:put ("Removing numeric id " . $Remove . "...\n"); | ||
/interface/wireless/access-list/remove $Remove; | ||
} | ||
} | ||
} | ||
} | ||
:set Seen ($Seen, $Mac); | ||
} |
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,3 @@ | ||
#!rsc by RouterOS | ||
# RouterOS script: backup-cloud | ||
# Copyright (c) 2013-2023 Christian Hesse <mail@eworm.de> | ||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md | ||
# | ||
# provides: backup-script | ||
# | ||
# upload backup to MikroTik cloud | ||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/backup-cloud.md | ||
|
||
:local 0 "backup-cloud"; | ||
:global GlobalFunctionsReady; | ||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; } | ||
|
||
:global BackupPassword; | ||
:global BackupRandomDelay; | ||
:global Identity; | ||
|
||
:global DeviceInfo; | ||
:global LogPrintExit2; | ||
:global RandomDelay; | ||
:global ScriptFromTerminal; | ||
:global SendNotification2; | ||
:global SymbolForNotification; | ||
:global WaitFullyConnected; | ||
|
||
$WaitFullyConnected; | ||
|
||
:if ([ $ScriptFromTerminal $0 ] = false && $BackupRandomDelay > 0) do={ | ||
$RandomDelay $BackupRandomDelay; | ||
} | ||
|
||
:do { | ||
# we are not interested in output, but print is | ||
# required to fetch information from cloud | ||
/system/backup/cloud/print as-value; | ||
:if ([ :len [ /system/backup/cloud/find ] ] > 0) do={ | ||
/system/backup/cloud/upload-file action=create-and-upload \ | ||
password=$BackupPassword replace=[ get ([ find ]->0) name ]; | ||
} else={ | ||
/system/backup/cloud/upload-file action=create-and-upload \ | ||
password=$BackupPassword; | ||
} | ||
:local Cloud [ /system/backup/cloud/get ([ find ]->0) ]; | ||
|
||
$SendNotification2 ({ origin=$0; \ | ||
subject=([ $SymbolForNotification "floppy-disk,cloud" ] . "Cloud backup"); \ | ||
message=("Uploaded backup for " . $Identity . " to cloud.\n\n" . \ | ||
[ $DeviceInfo ] . "\n\n" . \ | ||
"Name: " . $Cloud->"name" . "\n" . \ | ||
"Size: " . $Cloud->"size" . " B (" . ($Cloud->"size" / 1024) . " KiB)\n" . \ | ||
"Download key: " . $Cloud->"secret-download-key"); silent=true }); | ||
} on-error={ | ||
$SendNotification2 ({ origin=$0; \ | ||
subject=([ $SymbolForNotification "floppy-disk,warning-sign" ] . "Cloud backup failed"); \ | ||
message=("Failed uploading backup for " . $Identity . " to cloud!\n\n" . [ $DeviceInfo ]) }); | ||
$LogPrintExit2 error $0 ("Failed uploading backup for " . $Identity . " to cloud!") true; | ||
} | ||
# dummy for migration |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!rsc by RouterOS | ||
# RouterOS script: backup-cloud | ||
# Copyright (c) 2013-2023 Christian Hesse <mail@eworm.de> | ||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md | ||
# | ||
# provides: backup-script | ||
# | ||
# upload backup to MikroTik cloud | ||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/backup-cloud.md | ||
|
||
:local 0 "backup-cloud"; | ||
:global GlobalFunctionsReady; | ||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; } | ||
|
||
:global BackupPassword; | ||
:global BackupRandomDelay; | ||
:global Identity; | ||
|
||
:global DeviceInfo; | ||
:global LogPrintExit2; | ||
:global RandomDelay; | ||
:global ScriptFromTerminal; | ||
:global SendNotification2; | ||
:global SymbolForNotification; | ||
:global WaitFullyConnected; | ||
|
||
$WaitFullyConnected; | ||
|
||
:if ([ $ScriptFromTerminal $0 ] = false && $BackupRandomDelay > 0) do={ | ||
$RandomDelay $BackupRandomDelay; | ||
} | ||
|
||
:do { | ||
# we are not interested in output, but print is | ||
# required to fetch information from cloud | ||
/system/backup/cloud/print as-value; | ||
:if ([ :len [ /system/backup/cloud/find ] ] > 0) do={ | ||
/system/backup/cloud/upload-file action=create-and-upload \ | ||
password=$BackupPassword replace=[ get ([ find ]->0) name ]; | ||
} else={ | ||
/system/backup/cloud/upload-file action=create-and-upload \ | ||
password=$BackupPassword; | ||
} | ||
:local Cloud [ /system/backup/cloud/get ([ find ]->0) ]; | ||
|
||
$SendNotification2 ({ origin=$0; \ | ||
subject=([ $SymbolForNotification "floppy-disk,cloud" ] . "Cloud backup"); \ | ||
message=("Uploaded backup for " . $Identity . " to cloud.\n\n" . \ | ||
[ $DeviceInfo ] . "\n\n" . \ | ||
"Name: " . $Cloud->"name" . "\n" . \ | ||
"Size: " . $Cloud->"size" . " B (" . ($Cloud->"size" / 1024) . " KiB)\n" . \ | ||
"Download key: " . $Cloud->"secret-download-key"); silent=true }); | ||
} on-error={ | ||
$SendNotification2 ({ origin=$0; \ | ||
subject=([ $SymbolForNotification "floppy-disk,warning-sign" ] . "Cloud backup failed"); \ | ||
message=("Failed uploading backup for " . $Identity . " to cloud!\n\n" . [ $DeviceInfo ]) }); | ||
$LogPrintExit2 error $0 ("Failed uploading backup for " . $Identity . " to cloud!") true; | ||
} |
Oops, something went wrong.