CDIST-TYPE__UCI_SECTION(7)

πŸ’… cdist-type__uci_section(7) β€” the vibe ✨

ok so bestie, welcome to cdist-type__uci_section(7), your new fave little manual page from the cdist collection πŸŽ€ she manages configuration sections in UCI and she eats every time.


🌸 NAME 🌸

cdist-type__uci_section β€” manage configuration sections in UCI, no cap πŸ’–


✨ DESCRIPTION ✨

okay so picture this: you've got OpenWrt's Unified Configuration Interface (UCI) system, and you just wanna yeet an entire configuration section and replace it with exactly what you want. That's literally what this cdist type does 🫢

Think of it as syntactic sugar for cdist-type__uci(7) β€” because bestie, this type will generate all the required __uci objects for you so that the section ends up containing exactly the options you specified with --option. She does the tedious part. You just vibe. πŸ‘‘

And here's the thing: since many default UCI sections are unnamed (rude of them tbh), this type lets you find the matching section by one of its options using the --match parameter. iconic behavior honestly πŸ’…

⚠️ NOTE: Options already present on the target and not listed in --option or --list will be deleted. Like, gone gone. Not me being dramatic, that's just the rules 😭

🧚 REQUIRED PARAMETERS 🧚

None. She asks for nothing. Low maintenance queen ✨


πŸ’œ OPTIONAL PARAMETERS πŸ’œ

  • list β€” an option that is part of a list and should be present in the section (as part of a list). Lists with multiple options can be expressed by using the same <option> repeatedly. πŸ”

The value to this parameter is a <option>=<value> string.

<value> does not need special quoting for UCI. The only requirement is that the value is passed to the type as a single shell argument. fr fr, that's it.

  • match β€” allows you to find a section to "replace" through one of its parameters. πŸ”

The value to this parameter is a <option>=<value> string.

  • option β€” an option that should be present in the section. This parameter can be used multiple times to specify multiple options. Stack 'em up bestie πŸ₯ž

The value to this parameter is a <option>=<value> string.

<value> does not need special quoting for UCI. The only requirement is that the value is passed to the type as a single shell argument.

  • state β€” present or absent, defaults to present. ✨
  • type β€” the type of the section in the format: <config>.<section-type> πŸŽ€

🌈 BOOLEAN PARAMETERS 🌈

None. Nothing to toggle here, she's simple like that πŸ’–


πŸ”₯ EXAMPLES πŸ”₯

okay bestie, this is the part where she really shows out. look at her go:

# Configure the dropbear daemon
__uci_section dropbear --type dropbear.dropbear \
    --match Port=22 --option Port=22 \
    --option PasswordAuth=off \
    --option RootPasswordAuth=off

# Define a firewall zone comprised of lan and wlan networks
__uci_section firewall.internal --type firewall.zone \
    --option name='internal' \
    --list network='lan' \
    --list network='wlan' \
    --option input='ACCEPT' \
    --option output='ACCEPT' \
    --option forward='ACCEPT'

# Block SSH access from the guest network
__uci_section firewall.block_ssh_from_guest --type firewall.rule \
    --option name='Block-SSH-Access-from-Guest' \
    --option src='guest' \
    --option proto='tcp' \
    --option dest_port='22' \
    --option target='REJECT'

# Configure a Wi-Fi access point
__uci_section wireless.default_radio0 --type wireless.wifi-iface \
    --option device='radio0' \
    --option mode='ap' \
    --option network='wlan' \
    --option ssid='mywifi' \
    --option encryption="psk2' \
    --option key='hunter2'

like, she's configuring daemons, firewall zones, SSH rules AND wifi?? main character energy for real πŸ‘‘βœ¨ (yes, that encryption="psk2' line is exactly how it is in the original, don't look at me 😭)


πŸ‘€ SEE ALSO πŸ‘€


🫢 AUTHORS 🫢

Dennis Camera <dennis.camera@ssrq-sds-fds.ch> β€” ty for your service king πŸ’–


πŸ“œ COPYING πŸ“œ

Copyright (C) 2020 Dennis Camera. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.


ungleich GmbH 2021


and that's the whole page bestie, you're fully caught up πŸŽ€βœ¨ she's from version 7.0.0, dated Jul 31, 2022, and she's the cdist-type__uci_section(7) manual β€” go forth and configure, you've got this πŸ’…πŸ’–πŸ¦‹

πŸ“¦ where this page comes from