routeros-scripts-main/INITIAL-COMMANDS.md
Christian Hesse 93e593a891 revert to Telegram domain: t.me
... as it resolves to its address again.

This reverts commit 5b26c6b24e.
2026-07-14 14:34:51 +02:00

5.1 KiB
Raw Blame History

Initial commands

GitHub stars GitHub forks GitHub watchers required RouterOS version Telegram group @routeros_scripts donate with PayPal

⬅️ Go back to main README

⚠️ Warning: These commands are intended for initial setup. If you are not aware of the procedure please follow the long way in detail.

Run the complete base installation:

{
  :local BaseUrl "https://rsc.eworm.de/main/";
  :local CertCommonName "Root YE";
  :local CertFileName "Root-YE.pem";
  :local CertFingerprint "e14ffcad5b0025731006caa43a121a22d8e9700f4fb9cf852f02a708aa5d5666";

  :local CertSettings [ /certificate/settings/get ];
  :if (!((($CertSettings->"builtin-trust-store") ~ "fetch" || \
          ($CertSettings->"builtin-trust-store") = "all") && \
         [ :len [ /certificate/builtin/find where common-name=$CertCommonName ] ] > 0)) do={
    :put "Importing certificate...";
    /tool/fetch ($BaseUrl . "certs/" . $CertFileName) dst-path=$CertFileName as-value;
    :delay 1s;
    /certificate/import file-name=$CertFileName passphrase="";
    :if ([ :len [ /certificate/find where fingerprint=$CertFingerprint ] ] != 1) do={
      :error "Something is wrong with your certificates!";
    };
    :delay 1s;
  };
  :put "Renaming global-config-overlay, if exists...";
  /system/script/set name=("global-config-overlay-" . [ /system/clock/get date ] . "-" . [ /system/clock/get time ]) [ find where name="global-config-overlay" ];
  :foreach Script in={ "global-config"; "global-config-overlay"; "global-functions" } do={
    :put "Installing $Script...";
    /system/script/remove [ find where name=$Script ];
    /system/script/add name=$Script owner=$Script source=([ /tool/fetch check-certificate=yes-without-crl ($BaseUrl . $Script . ".rsc") output=user as-value ]->"data");
  };
  :put "Loading configuration and functions...";
  /system/script { run global-config; run global-functions; };
  :if ([ :len [ /certificate/find where fingerprint=$CertFingerprint ] ] > 0) do={
    :put "Renaming certificate by its common-name...";
    :global CertificateNameByCN;
    $CertificateNameByCN $CertFingerprint;
  };
};

Then continue setup with scheduled automatic updates or editing configuration.

Install from mirror

In case you have issues with my default source using a mirror may help. Just replace the first lines for updated variables.

💡 Hint: You may want to set the same url with ScriptUpdatesBaseUrl in global-config-overlay.

⚠️ Warning: The mirrors do not provide checksums. Each invocation of $ScriptInstallUpdate takes longer and generates more traffic, as every script needs to be downloaded for local check!

Install from git.eworm.de

  :local BaseUrl "https://git.eworm.de/cgit/routeros-scripts/plain/";
  :local CertCommonName "Root YE";
  :local CertFileName "Root-YE.pem";
  :local CertFingerprint "e14ffcad5b0025731006caa43a121a22d8e9700f4fb9cf852f02a708aa5d5666";

Install from Github

  :local BaseUrl "https://raw.githubusercontent.com/eworm-de/routeros-scripts/main/";
  :local CertCommonName "Root YR";
  :local CertFileName "Root-YR.pem";
  :local CertFingerprint "e57b7e6f150c419102e8d5c055729ff967b9d1a829bf00cec89ca604ebf4a86f";

Install from Gitlab

  :local BaseUrl "https://gitlab.com/eworm-de/routeros-scripts/raw/main/";
  :local CertCommonName "Sectigo Public Server Authentication Root R46";
  :local CertFileName "Sectigo-Public-Server-Authentication-Root-R46.pem";
  :local CertFingerprint "7bb647a62aeeac88bf257aa522d01ffea395e0ab45c73f93f65654ec38f25a06";

Fix existing installation

The initial commands above allow to fix an existing installation in case it ever breaks. If global-config-overlay did exist before it is renamed with a date and time suffix (like global-config-overlay-2024-01-25-09:33:12). Make sure to restore the configuration overlay if required.


⬅️ Go back to main README
⬆️ Go back to top