Running A Script; Examples Of Scripts That Perform Specific Functions; A Login Script - Digi PortServer II User Manual

Communication terminal server
Table of Contents

Advertisement

Running a script

When a script is invoked, the modem initializes to the state specified by commands
C1 A80 H- D+1 D+2 Q0 T- S10 and the script executes beginning at line s1.
As each state is entered, previous [] command strings are cleared, and execution
proceeds from left to right.
If a command is encountered which causes a change of state (for example, Gs), any
remaining commands in the current state are not performed, and execution resumes in
the new state.
Otherwise, when all commands in a state have been executed, and at least one []
command has been seen, the communication line is read. Incoming characters are then
matched against previously declared [] command strings. If a match is found, the
corresponding state transfer occurs. If carrier sense was enabled by the C command
and carrier is lost, the last H command is honored. If neither of these events occur
within the timeout specified by the last S command, a timeout is detected. Action is
then taken according to the last T command.

Examples of scripts that perform specific functions

A login script

The following script uses parameters p1 and p2 as login name and password. The
script writes a success or failure message to the log file for each access attempt, using
the trace facility (see Chapter 17, Troubleshooting):
s1="[ogin:]2 S20 T4"
s2='P2 M{%1\r} P1 [sword:]3 T4" //pause 2 seconds, send param1
s3="M{%2\r} G5"
s4="E{login failed} G-"
s5="E{login complete} G+" //Write Success message, Exit indi
90030500B
//wait 20 seconds for ogin:
/if timeout goto s4;if ogin: goto s2
to //port; wait 1 second for sword:
//send param 2 to port,go to state 5
//Write Fail message, Exit indicating
//General failure
//cating Success
Configuring Modem Connections
Page 133

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents