2
Management
27
Script validation and command ordering
CLI
scripts
are
not,
by
default,
validated
and
the
ordering
of
the
commands
does
not
matter.
There
can
be
a
reference
to
a
configuration
object
at
the
beginning
of
a
script
that
is
created
only
at
the
end
of
the
script.
Although
this
might
seem
illogical,
it
is
done
to
improve
the
readability
of
scripts.
If
something
always
has
to
be
created
before
it
is
referred
to,
this
can
result
in
a
confused
and
disjointed
script
file.
In
long
scripts
it
is
often
preferable
to
group
together
similar
CLI
commands.
Error handling
If
an
executing
CLI
script
file
encounters
an
error
condition,
the
default
behavior
is
for
the
script
to
terminate.
This
behavior
can
be
overridden
by
using
the
‐
force
option.
To
run
a
script
file
called
my_script2.sgs
in
this
way,
the
CLI
command
is:
Device:/>
script
‐
run
‐
name=my_script2.sgs
‐
force
If
‐
force
is
used,
the
script
will
continue
to
execute
even
if
errors
are
returned
by
a
command
in
the
script
file.
Script output
Any
output
from
script
execution
will
appear
at
the
CLI
console.
Normally
this
output
consists
only
of
any
error
messages
that
occur
during
execution.
To
see
the
confirmation
of
each
command
completing,
the
‐
verbose
option
should
be
used:
Device:/>
script
‐
run
‐
name=my_script2.sgs
‐
verbose
Scripts are lost after restart
When
a
script
file
is
uploaded
to
the
SEG,
it
is
kept
in
temporary
memory.
If
the
SEG
restarts,
any
uploaded
scripts
will
be
lost
from
memory
and
must
be
uploaded
again
before
they
can
run.
To
move
the
example
my_script.sgs
to
non
‐
volatile
memory,
the
command
would
be:
Device:/>
script
‐
store
‐
name=my_script.sgs
Alternatively,
all
scripts
can
be
moved
to
non
‐
volatile
memory
with
the
command:
Device:/>
script
‐
store
‐
all
Removing scripts
To
remove
a
saved
script,
the
script
‐
remove
command
can
be
used.
To
remove
the
example
my_script.sgs
script
file,
the
command
would
be:
Device:/>
script
‐
remove
‐
name=my_script.sgs