Anybody know how to do this? I'm trying to do an ash script to automate some of the setup from information on an SD card. I've found how to change the system name, and turn wifi on or off, change ssid etc, but not how to enable REST commands.
uci show arduino
arduino.@arduino[0]=arduino
arduino.@arduino[0].password=775e9f944188a7bcb36e9ca5dc51672b44bcceeb7d56d89dfb914eb3a1ff2d69
arduino.@arduino[0].secure_rest_api=true
arduino.radio0=wifi-device
arduino.@wifi-iface[0]=wifi-iface
arduino.lan=interface
opkg install coreutils-sha256sum
echo -n arduino | sha256sum
775e9f944188a7bcb36e9ca5dc51672b44bcceeb7d56d89dfb914eb3a1ff2d69
#!/bin/sh
/sbin/uci set arduino.@arduino[0]=arduino
/sbin/uci set arduino.@arduino[0].password=775e9f944188a7bcb36e9ca5dc51672b44bcceeb7d56d89dfb914eb3a1ff2d69
/sbin/uci set arduino.@arduino[0].secure_rest_api=true
/sbin/uci set arduino.radio0=wifi-device
/sbin/uci set arduino.@wifi-iface[0]=wifi-iface
/sbin/uci set arduino.lan=interface
/sbin/uci commit arduino
this is perfect!
sonnyu, what does this line do?
echo -n arduino | sha256sum
775e9f944188a7bcb36e9ca5dc51672b44bcceeb7d56d89dfb914eb3a1ff2d69
It is sonnyyu!
echo -n arduino | sha256sum
"arduino" is password for root.
"775e9f944188a7bcb36e9ca5dc51672b44bcceeb7d56d89dfb914eb3a1ff2d69" is hash key sha256 of "arduino".
whoops, sorry sonnyyu
I actually meant what is the purpose of that line in itself. I don't see why it's needed.
In fact, why is it that i need sha256sum in the first place? It looks like I can modify "uci arduino" without it.
It is for reset password.
echo -n newpassword | sha256sum
will give new hash key for "newpassword", put it into
/sbin/uci set arduino.@arduino[0].password=hashkey