Cisco SPA2102-AU Provisioning Guide - Page 36

Conditional Expressions

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

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94

2-10
Linksys SPA Provisioning Guide
Version 3.0
Chapter 2
Creating Provisioning Scripts
Proprietary Plain-Text Configuration File
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)