Cisco SPA2102-AU Provisioning Guide - Page 36
Conditional Expressions
View all Cisco SPA2102-AU manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 36 highlights
Proprietary Plain-Text Configuration File Chapter 2 Creating Provisioning Scripts During macro expansion, expressions of the form $NAME and $(NAME) are replaced by the contents of the named variables. See the "Macro Expansion Variables" section on page 4-7 for the complete list of variables available for macro expansion. These include general purpose parameters, several product identifiers, certain event timers, and provisioning state values. For example, for a SPA with MAC address 000E08012345, the expression: spa$(MAU)config.cfg macro-expands into the following string: spa000E08012345config.cfg If a macro name is not recognized, it remains unexpanded. For example, The name STRANGE is not recognized as a valid macro name, while MAU is recognized as a valid macro name; so the expression: spa$STRANGE$MAU.cfg macro-expands into the string: spa$STRANGE000E08012345.cfg Macro expansion is not applied recursively. For example, $$MAU" expands into $MAU" (the $$ is expanded), and not 000E08ABCDEF", for a SPA with the indicated MAC address. The special purpose parameters (GPP_SA through GPP_SD), whose contents are mapped to the macro expressions $SA through $SD, are only macro expanded as the argument of the --key option in a resync URL. Also, the macro expression can qualify the expansion so that only a substring of the macro variable is used instead of its full value, such as a portion of the MAC address. The syntax for substring macro expansion is $(NAME:p) and $(NAME:p:q), where p and q are non-negative integers. The resulting expansion results in the macro variable substring starting at character offset p, and of length q (or till end-of-string if q is not specified). For example, for an SPA with MAC address 000E08012345, the expression $(MAU:4) macro-expands into the string 08012345, while the expression $(MAU:8:2) macro-expands into the string 23 Conditional Expressions Conditional expressions can trigger resync events and select from alternative URLs for resync and upgrade operations. Conditional expressions consist of a list of comparisons, separated by the and operator. All comparisons must be satisfied for the condition to be true. Each comparison can relate one of three types of literals: integer values, software or hardware version numbers, and doubled-quoted strings. Note that version numbers take the form of three non-negative integers separated by periods (major, minor, and build numbers), plus an optional alphanumeric string in parentheses. No intervening spaces are allowed. The following are examples of valid version numbers: 1.0.31(b) 1.0.33 2.0.3(G) 2.0.3(0412s) 2-10 Linksys SPA Provisioning Guide Version 3.0