Skip to content

Instantly share code, notes, and snippets.

@stephenlauck
Last active December 17, 2024 07:24
Show Gist options
  • Save stephenlauck/89d394fe39dffe0ef52aea26a82b52ae to your computer and use it in GitHub Desktop.
Save stephenlauck/89d394fe39dffe0ef52aea26a82b52ae to your computer and use it in GitHub Desktop.
Spellcaster spell to configure Mikrotik hEX PoE
: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