I am using a RPi for monitoring a remote ethernet device.
Everything works fine but I would like to improve one point :
The RPi opens a WiFi Access Point for configuration purpose. I would like to automatically disable the access point after some time (1 hour for instance).
The @reboot in cron is not implemented. You can use /etc/rc.local for startup scripts.
However the way you do it, next time the rpi boots it will be disabled.
I also have a uci default file which create the AP.
May I add this line after creating the AP:
uci set wireless.wifinet0=wifi-iface
uci set wireless.wifinet0.device='radio0'
uci set wireless.wifinet0.mode='ap'
uci set wireless.wifinet0.ssid="monitor"
uci set wireless.wifinet0.encryption='psk2'
uci set wireless.wifinet0.key="monitor"
uci set wireless.wifinet0.network='lan'
uci set wireless.wifinet0.disabled='0'
uci commit wireless
wifi reload
sleep 3600 && uci set wireless.wifinet0.disabled='1' && uci commit wireless && wifi reload &
...
// never return 0, this script should always be executed
exit 1
I think you have overcomplicated the whole thing. wifi down will bring down the wifi and that's all you need till the next reboot.
Let it wait for an hour and then run the wifi down