OpenWrt Forum Archive

Topic: can it possible to call the script file in source code??

The content of this topic has been archived on 27 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

H Devs..,

I have to apply the following config from my script to all my routers, If i try to call it from /etc/rc.local in all my routers then its big task.


File : sample.sh

#!/bin/sh
uci set system.@system[0].log_size=4096
uci set system.@system[0].log_type=file
uci set system.@system[0].cronloglevel=5
uci set system.@system[0].log_file= /etc/AP_Logs
uci set wireless.radio0.log_level=1
uci commit system
uci commit wireless
exit 0


so i thought, if i can call it from my source code, and build the image. then it will be easy, Just need to load the image in my Routers,

So, can it possible to call the script file in source code??

Tx, in advance

This is the third question you've posted on the same subject. Call your script in /etc/rc.local

This is the easiest. Any other method requires more effort to implement. Building a custom image is much more complicated

really sorry for that...will delete the redundant post..

While it would require some learning/doing, I recommend you research the Image Builder and uci-defaults scripts, with those you can package these commands into the custom firmware for your routers.

The discussion might have continued from here.