Skip to content

Instantly share code, notes, and snippets.

@sebastian13
Last active August 4, 2022 10:12
Show Gist options
  • Select an option

  • Save sebastian13/c1493a12d57e2f871cb1224a5efb3c07 to your computer and use it in GitHub Desktop.

Select an option

Save sebastian13/c1493a12d57e2f871cb1224a5efb3c07 to your computer and use it in GitHub Desktop.

Revisions

  1. sebastian13 revised this gist Aug 4, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion download-caps-routeros.rsc
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@
    /tool fetch mode=https url="https://download.mikrotik.com/routeros/$installed/routeros-$installed-arm.npk" dst-path="capsman-routeros/routeros-$installed-arm.npk"

    # Initiate Upgrade
    :local caps [/caps-man remote-cap find where version!="7.4"]
    :local caps [/caps-man remote-cap find where version!="$installed"]

    :foreach i in=$caps do={
    :put "Initiate Upgrade on $i"
  2. sebastian13 revised this gist Aug 4, 2022. 1 changed file with 7 additions and 2 deletions.
    9 changes: 7 additions & 2 deletions download-caps-routeros.rsc
    Original file line number Diff line number Diff line change
    @@ -9,5 +9,10 @@
    /tool fetch mode=https url="https://download.mikrotik.com/routeros/$installed/routeros-$installed-arm.npk" dst-path="capsman-routeros/routeros-$installed-arm.npk"

    # Initiate Upgrade
    /caps-man remote-cap
    upgrade numbers=[ find where version=!"$installed"]
    :local caps [/caps-man remote-cap find where version!="7.4"]

    :foreach i in=$caps do={
    :put "Initiate Upgrade on $i"
    /caps-man remote-cap upgrade numbers=$i
    :delay 60s
    };
  3. sebastian13 revised this gist Jul 8, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion download-caps-routeros.rsc
    Original file line number Diff line number Diff line change
    @@ -10,4 +10,4 @@

    # Initiate Upgrade
    /caps-man remote-cap
    upgrade numbers=[ find ]
    upgrade numbers=[ find where version=!"$installed"]
  4. sebastian13 revised this gist Jul 8, 2022. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions download-caps-routeros.rsc
    Original file line number Diff line number Diff line change
    @@ -7,3 +7,7 @@
    # URL only valid for RouterOS v7
    /tool fetch mode=https url="https://download.mikrotik.com/routeros/$installed/routeros-$installed-mipsbe.npk" dst-path="capsman-routeros/routeros-$installed-mipsbe.npk"
    /tool fetch mode=https url="https://download.mikrotik.com/routeros/$installed/routeros-$installed-arm.npk" dst-path="capsman-routeros/routeros-$installed-arm.npk"

    # Initiate Upgrade
    /caps-man remote-cap
    upgrade numbers=[ find ]
  5. sebastian13 revised this gist Jul 8, 2022. 2 changed files with 10 additions and 7 deletions.
    3 changes: 2 additions & 1 deletion $mikrotik-capsman-download.md
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,8 @@

    ```
    /system scheduler
    add name=download-caps-routeros interval=1d start-time=05:00:00 on-event=download-caps-routeros
    add name=download-caps-routeros on-event=":delay 120s\
    \n/system script run download-caps-routeros" start-time=startup
    ```

    3. Set the Package-Path
    14 changes: 8 additions & 6 deletions download-caps-routeros.rsc
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,9 @@
    :local latest
    /system package update check-for-updates once
    :delay 5s;
    :set latest "$[/system package update get latest-version]"
    :put "Cleanup old downloads"
    /file remove numbers=[ find where name="capsman-routeros" ]

    /tool fetch mode=http url="https://download.mikrotik.com/routeros/$latest/routeros-mipsbe-$latest.npk" dst-path="capsman-routeros/routeros-mipsbe-$latest.npk"
    /tool fetch mode=http url="https://download.mikrotik.com/routeros/$latest/routeros-arm-$latest.npk" dst-path="capsman-routeros/routeros-arm-$latest.npk"
    :local installed [/system package get routeros version]
    :put "Running RouterOS $installed. Will download CAPs RouterOS packages."

    # URL only valid for RouterOS v7
    /tool fetch mode=https url="https://download.mikrotik.com/routeros/$installed/routeros-$installed-mipsbe.npk" dst-path="capsman-routeros/routeros-$installed-mipsbe.npk"
    /tool fetch mode=https url="https://download.mikrotik.com/routeros/$installed/routeros-$installed-arm.npk" dst-path="capsman-routeros/routeros-$installed-arm.npk"
  6. sebastian13 revised this gist Jul 8, 2022. 2 changed files with 10 additions and 3 deletions.
    13 changes: 10 additions & 3 deletions $mikrotik-capsman-download.md
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,19 @@
    ## Download RouterOS packages for CAPs on CAPsMAN

    1. Create the script **download-routeros-for-cap**. Add or remove packages, depeding on caps' hardware.
    1. Create the script **download-caps-routeros**. Add or remove packages, depeding on caps' hardware.

    2. Set the Package-Path
    2. Add a scheduler

    ```
    /system scheduler
    add name=download-caps-routeros interval=1d start-time=05:00:00 on-event=download-caps-routeros
    ```

    3. Set the Package-Path

    ```
    /caps-man manager
    set package-path=/capsman-routeros upgrade-policy=suggest-same-version
    ```

    3. Add the [upgrade-firmware script](https://gist.github.com/sebastian13/3b05cbbbdd3326a402391e81e1a8f7af#file-upgrade-firmware-rsc) to the cap. Set startup scheduler.
    4. Add the [upgrade-firmware script](https://gist.github.com/sebastian13/3b05cbbbdd3326a402391e81e1a8f7af#file-upgrade-firmware-rsc) to the cap. Set startup scheduler.
  7. sebastian13 created this gist Jul 8, 2022.
    12 changes: 12 additions & 0 deletions $mikrotik-capsman-download.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    ## Download RouterOS packages for CAPs on CAPsMAN

    1. Create the script **download-routeros-for-cap**. Add or remove packages, depeding on caps' hardware.

    2. Set the Package-Path

    ```
    /caps-man manager
    set package-path=/capsman-routeros upgrade-policy=suggest-same-version
    ```

    3. Add the [upgrade-firmware script](https://gist.github.com/sebastian13/3b05cbbbdd3326a402391e81e1a8f7af#file-upgrade-firmware-rsc) to the cap. Set startup scheduler.
    7 changes: 7 additions & 0 deletions download-routeros-for-cap.rsc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    :local latest
    /system package update check-for-updates once
    :delay 5s;
    :set latest "$[/system package update get latest-version]"

    /tool fetch mode=http url="https://download.mikrotik.com/routeros/$latest/routeros-mipsbe-$latest.npk" dst-path="capsman-routeros/routeros-mipsbe-$latest.npk"
    /tool fetch mode=http url="https://download.mikrotik.com/routeros/$latest/routeros-arm-$latest.npk" dst-path="capsman-routeros/routeros-arm-$latest.npk"