Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docs:guide-developer:uci-defaults [2023/01/17 13:10] – [Examples] vgaeteradocs:guide-developer:uci-defaults [2023/10/14 09:08] (current) – [UCI defaults] vgaetera
Line 7: Line 7:
 To set some system defaults the first time the device boots, create a script in the directory ''/etc/uci-defaults''. To set some system defaults the first time the device boots, create a script in the directory ''/etc/uci-defaults''.
  
-All scripts in that directory are automatically executed by ''/etc/init.d/boot'':+All scripts in that directory are automatically executed by the ''boot'' service:
   * If they exit with code 0 they are deleted afterwards.   * If they exit with code 0 they are deleted afterwards.
   * Scripts that exit with non-zero exit code are not deleted and will be re-executed at the next boot until they also successfully exit.   * Scripts that exit with non-zero exit code are not deleted and will be re-executed at the next boot until they also successfully exit.
Line 32: Line 32:
 uci -q batch << EOI uci -q batch << EOI
 set network.lan.ipaddr='192.168.178.1' set network.lan.ipaddr='192.168.178.1'
-commit network 
 set wireless.@wifi-device[0].disabled='0' set wireless.@wifi-device[0].disabled='0'
 set wireless.@wifi-iface[0].ssid='OpenWrt0815' set wireless.@wifi-iface[0].ssid='OpenWrt0815'
-commit wireless 
 add dhcp host add dhcp host
 set dhcp.@host[-1].name='bellerophon' set dhcp.@host[-1].name='bellerophon'
 set dhcp.@host[-1].ip='192.168.2.100' set dhcp.@host[-1].ip='192.168.2.100'
 set dhcp.@host[-1].mac='a1:b2:c3:d4:e5:f6' set dhcp.@host[-1].mac='a1:b2:c3:d4:e5:f6'
-commit dhcp 
 rename firewall.@zone[0]='lan' rename firewall.@zone[0]='lan'
 rename firewall.@zone[1]='wan' rename firewall.@zone[1]='wan'
 rename firewall.@forwarding[0]='lan_wan' rename firewall.@forwarding[0]='lan_wan'
-commit firewall 
 EOI EOI
 EOF EOF
Line 64: Line 60:
  
 ===== Examples ===== ===== Examples =====
 +  * [[docs:guide-user:additional-software:imagebuilder#restricting_root_access|Restricting root access]]
   * [[https://github.com/openwrt/openwrt/tree/master/package/base-files/files/etc/uci-defaults|uci-defaults @ base-files]]   * [[https://github.com/openwrt/openwrt/tree/master/package/base-files/files/etc/uci-defaults|uci-defaults @ base-files]]
   * [[https://github.com/freifunk-berlin/firmware-packages/tree/master/defaults|uci-defaults @ Freifunk Berlin]]   * [[https://github.com/freifunk-berlin/firmware-packages/tree/master/defaults|uci-defaults @ Freifunk Berlin]]
  • Last modified: 2023/01/17 13:10
  • by vgaetera