set
Write NVRAM parameters to a device
go-udap set MAC [--reboot|-r] [--config FILE] [--<param> VALUE ...]
[--timeout DURATION] [--format text|json|csv | --json]What it does
Writes one or more NVRAM parameters to the device. The wire op writes
NVRAM directly — every UCP_METHOD_SET_DATA writes; there is no
separate save_data method.
Parameter values are layered from three sources, in the following priority (later wins):
--config FILE— INI-formatkey=valuefile- Piped stdin (use
--config -or just pipe to stdin) - Per-parameter flags (
--hostname newname,--lan-ip-mode 1, etc.)
Pass --reboot/-r to also reboot the device afterwards. Some
changes (e.g. network config) only take effect after reboot.
On factory-fresh devices the NVRAM interface byte holds an "unset"
sentinel that firmware refuses to act on. If you omit --interface,
set substitutes wired by default — or wireless when wireless_SSID
is supplied — and prints the substitution on stderr. Pass --interface
explicitly to suppress the notice.
Output
On success, set prints the parameters it wrote: the merged values
from every source, including any interface substitution. The default
text format is the same param=value lines as
read, sorted by name.
With --json (or -o json), one object mapping each parameter name to
its value, sorted by name. Values are always strings:
{"hostname":"den","lan_ip_mode":"0"}With -o csv, a name,value header and one row per parameter, sorted
by name:
name,value
hostname,den
lan_ip_mode,0The JSON keys and CSV columns are a stable contract: none will be removed or renamed without a major version. New ones may be added. See Output formats.
Flags
| Flag | Default | Description |
|---|---|---|
--config FILE | — | INI-format config file. Use - to read from stdin |
--reboot, -r | off | Also reboot the device after writing |
--timeout DURATION | 2s | Operation timeout |
--format FORMAT, -o | text | Output format: text, json or csv |
--json | off | Shorthand for --format json |
--<param> VALUE | — | One flag per parameter you want to set (see NVRAM parameters for the canonical list) |
Exit codes
0— success1— device not found, or transport error2— invalid MAC, unknown parameter, malformed config, or an unknown or invalid flag (including a format name other thantext,jsonorcsv, or--jsonwith--format)
Examples
DHCP on wireless with WPA2:
go-udap set 00:04:20:16:06:02 \
--interface 0 --lan-ip-mode 1 \
--wireless-ssid SlimNet --wireless-wpa-on 1 --wireless-wpa-mode 2 \
--wireless-wpa-psk 'shared-secret' \
--server-address 192.168.1.250 \
--rebootRestore from a backup:
go-udap set 00:04:20:16:06:02 --config backup.conf --rebootPipe parameters from stdin:
go-udap set 00:04:20:16:06:02 <<EOF
interface=1
lan_ip_mode=0
lan_network_address=192.168.1.50
lan_subnet_mask=255.255.255.0
lan_gateway=192.168.1.1
EOFSee Config file format for the .conf syntax.