Community discussions

MikroTik App
 
User avatar
stereomind
just joined
Topic Author
Posts: 24
Joined: Mon Sep 25, 2006 5:12 pm

Webfig skins and provisioning

Wed Jul 08, 2015 11:52 pm

Hello folks.

Is it possible to provision new CPE routerboards using netinstall/flashfig and upload a custom webfig skin at the same time?

I figured out how to provision the configuration part, but don't see how files can be transferred easily without having to log into the router after flashfig. I guess it's possible with /tool fetch in the setup script, but I was hoping for a simpler, one-shot solution.

Thanks!
 
viktorc
just joined
Posts: 18
Joined: Mon Jun 05, 2006 4:00 pm

Re: Webfig skins and provisioning

Fri Dec 08, 2017 4:58 pm

Hi,

I needed same thing and failed.
Reason is (IMHO), flashfig is not running as admin, but "*sys" - which has lower privileges. This is not enough to download .json file from ftp server.

How to reproduce:
- create skin.json (in WebFig) and upload it to FTP server
- rename it to skin.txt and upload it to FTP again
- create flashfig.rsc script which activates internet connection and at end add:
/tool fetch "ftp://my.server.com/skin.txt";
/tool fetch "ftp://my.server.com/skin.json";
- apply flashfig to router (via netinstall/flashfig) and power cycle router
- after boot, you will see downloaded skin.txt, but not skin.json

If you copy flashfig.rsc to router (without default config) as admin and import, both files downloads successfully.

In flashfig.rsc I tryed add /system script and schedule it on startup, but still running with not enough privileges.

Tested on 6.40.4

Is any way to download skin in flashfig?

Thanks.
 
viktorc
just joined
Posts: 18
Joined: Mon Jun 05, 2006 4:00 pm

Re: Webfig skins and provisioning

Wed Dec 13, 2017 11:42 am

Hi,

I tried to upload and run script via tr069-client - but this is run as user "*sys" too.

I tried fetch txt file and store it (dst-path) as json - without success.

I tried to elevate "*sys" priviledges via ssh to localhost as admin - without success ("*sys" can't run ssh client?).

I can't find method to copy/rename/move txt file to json in Mikrotik.

If router is not behind NAT, there can be solution: fetch php script from server which connect (from web server) back to router as admin and downloads nedded json. Problem is NAT.

Is any real solution to provide webfig skin via automatic provisioning?