Need to fix this update script:

As described in http://forum.mikrotik.com/t/capsman-how-to-keep-npk-updated-cap-manager-auto-update/116731/1 I’m using this line to downlad new npk files into CAPs manager to be available to APs update (as “require same version”) :

/tool fetch address="download.mikrotik.com" mode=https src-path="/routeros/$newVer/routeros-mipsbe-$newVer.npk" dst-path="/apdir"

The problem is the /apdir directory keeps filling with all old no more used routeros-mipsbe-xxxxxx.npk files (10MB each) , resulting in no more space left .

As I’m not expert in scripting, how can I modify script to delete old npk file when a new one has been downloaded ? (code example)

Thank you