Complete setup wizard via CLI

Hi guys,

I wrote a Python script to speed up the configuration of a batch of new GL.iNet GL-AR300M16 routers. The scripts logs in via SSH and sets the root password, wireless settings, scheduled reboot and more via various uci and shell commands. The script works great, but the setup wizard at http://192.168.8.1/#/welcome remains active. It still asks you to choose a language and set an admin password. Is there a way (e.g. via uci or a shell command) to set the admin password and mark the setup as complete?
Thanks in advance for your help.

Kind regards,

Paul

1 Like

Hello,

You can add the following API in the script to complete wizard.

curl -k http://127.0.0.1/rpc -H 'glinet: 1' -d '{"jsonrpc":"2.0","id":5,"method":"call","params":["","ui","init",{"lang":"en","username":"root","password":"goodlife","security_rule":0}]}'

You can define the language, password, and whether to allow weak passwords security_rule

Tips:

  1. To execute this API, it needs to SSH login first
  2. Before completing wizard, it does not need password to login; after completing wizard, a password you define to re-login SSH
1 Like

Yes, that worked perfectly. Thank you!