Last active
December 17, 2024 07:24
-
-
Save stephenlauck/89d394fe39dffe0ef52aea26a82b52ae to your computer and use it in GitHub Desktop.
Spellcaster spell to configure Mikrotik hEX PoE
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
:put "Generated by Spellcaster ☱" | |
:put "© 2023, Distinguished LLC. All rights reserved." | |
:put ("Mikrotik " . [system resource get version] . " Configuration ") | |
:put "" | |
:local converged ""; | |
:for LoopCount from=1 to=10 do={ | |
:set $converged ($converged . "☱ ") | |
} | |
:put "DNS servers should be set" | |
:if ([ip dns get servers]="8.8.8.8;1.1.1.1") do={ | |
:put "DNS servers already set" | |
} else={ | |
:put "setting DNS servers" | |
ip dns set servers=8.8.8.8,1.1.1.1 | |
} | |
:put $converged | |
:put "" | |
:put "the system should be to date" | |
:if ( [system package update get installed-version] >= [system package update check-for-updates once; :delay 5s; system package update get latest-version]) do={ | |
:put "System already up to date" | |
} else={ | |
:put "Updating system"; system package update install | |
} | |
:put $converged | |
:put "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment