aboutsummaryrefslogtreecommitdiffstats
path: root/remove-packages
blob: 6de1c3945c598595a296eb7c07a99391b090a626 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!rsc
# RouterOS script: remove-packages
# Copyright (c) 2013-2018 Christian Hesse <mail@eworm.de>
#
# remove packages (*.npk) not matching installed version

:local version [ / system package update get installed-version ];

:foreach package in=[ / file find type="package" ] do={
  :local filename [ / file get $package name ];
  :if ($filename~$version) do={
    :log debug ("Package file " . $filename . " is up-to-date.");
  } else={
    :log debug ("Removing old packge file: " . $filename);
    / file remove $package;
  }
}