PAYLOAD_GET_CONFIG - Retrieve a payload configuration option

PAYLOAD_SET_CONFIG - Set a payload configuration option

PAYLOAD_DEL_CONFIG - Delete a payload configuration option

When to use them

The PAYLOAD_..._CONFIG commands offer a convenient way to save payload options in the central system configuration store. Configuration options saved this way will persist across firmware upgrades.

PAYLOAD_GET_CONFIG

Syntax

PAYLOAD_GET_CONFIG [payload name] [value] 

payload name required

Simple name of the payload. This must not contain spaces, and should be unique. The payload name is used to distinguish between different payloads using the same variable names, and should be a variation of your payloads name.

value required

Variable name to fetch

PAYLOAD_SET_CONFIG

Syntax

PAYLOAD_SET_CONFIG [payload name] [value] [value] 

payload name required

Simple name of the payload. This must not contain spaces, and should be unique. The payload name is used to distinguish between different payloads using the same variable names, and should be a variation of your payloads name.

value required

Variable name to set

value required

Value of variable

PAYLOAD_DEL_CONFIG

Syntax

PAYLOAD_DEL_CONFIG [payload name] [value] 

payload name required

Simple name of the payload. This must not contain spaces, and should be unique. The payload name is used to distinguish between different payloads using the same variable names, and should be a variation of your payloads name.

value required

Variable name to set

Results

PAYLOAD_GET_CONFIG returns the option value as the output of the command, and sets a return code of 0 on success and non-zero on failure.

PAYLOAD_SET_CONFIG sets a return code of 0 on success and non-zero on failure. The most common cause of a failure is an attempt to set a value for an illegal payload or variable name.

PAYLOAD_DEL_CONFIG will never return an error. In the event of an illegal payload or variable name, or if the config value is not found, it will simply be ignored.

Examples

  PAYLOAD_SET_CONFIG demopayload host "1.2.3.4"
  
  # ignore an error, we don't care
__config_host=$(PAYLOAD_GET_CONFIG demopayload host)
__host=$(TEXT_PICKER "Hostname" "${__config_host}") || exit 0