home *** CD-ROM | disk | FTP | other *** search
-
- !================================================
- ! LOGIN.ECF - An example login command file |
- !================================================
-
- ! This example logs onto a VAX/VMS system.
- ! Sections are commented out that can be incorporated for different
- ! logon procedures.
- ! Timeout values can be increased, if desired.
- ! Again, this is only an example. Modifications will be necessary to
- ! connect to your specific system.
-
-
- !------------------------------------------------------------------------------
- !Variables used in this command file
-
- user_name = "MyName" !Place your user name in quotes here
- pass_name = "MyPassword" !Place your password in quotes here
- count = 0 !Count number of times to try wait
- label = "user" !first label if timeout occurs
-
- !------------------------------------------------------------------------------
-
- BEGIN: !Label to mark beginning of routine
-
- !------------------------------------------------
- ! If you need to dial to get onto your system, |
- ! take the comments off of the beginning of the |
- ! next two lines: |
- !
- ! DIAL VAX !Dials the Modem Dialer entry "VAX"
- ! !(replace "VAX" with your modem entry)
- !
- ! IF .not. $STATUS THEN GOTO PROBLEM !If error occurred in connecting,
- ! !goto label PROBLEM
-
- !------------------------------------------------
- ! If you dial into varying host systems, |
- ! take the comments off of the beginning of the |
- ! next three lines instead: |
- !
- ! INQUIRE /STATUS TEMP "To which host system would you like to connect? "
- ! !Prompt for Modem Dialer entry
- !
- ! DIAL 'TEMP' !Dial the entry
- !
- ! IF .not. $STATUS THEN GOTO PROBLEM !If error occurred in connecting,
- ! !goto label PROBLEM
- !
- ! End of the dialing section |
- !------------------------------------------------
-
- !------------------------------------------------
- ! If you come through a switchboard, take the |
- ! comments off of the following 9 lines: |
- !
- !READ_LOOP: !Loop label for read information
- !
- ! label = "read_loop" !Label for timeout routine
- !
- ! WRITE HOST !Send a carriage return to host
- !
- ! READ /ERROR=LOOP /TIME=5 HOST TEMP !Reads any information for next 5 secs
- !
- ! IF TEMP .eqs. "" THEN GOTO READ_LOOP !If haven't got anything, loop
- !
- ! IF TEMP .eqs. "Username:" THEN GOTO USER10 !Jump if at user prompt
- !
- ! INQUIRE /STATUS TEMP "To which host system would you like to connect? "
- ! !Prompt on status line for host name
- !
- ! WRITE HOST "C ''temp'" !Send connect host name
- !
- ! DELAY 5 !Delay 5 secs before carriage return
- !
- ! End of switchboard example |
- !------------------------------------------------
-
- WRITE HOST !Send a carriage return to host
-
- USER: !Label for timeout routine
-
- label = "user" !Update label for timeout routine
-
- WAIT /ERROR=LOOP /TIME=5 "Username:" !Waits 5 seconds for the "Username"
- ! prompt. (Place your user prompt here)
-
- ! WAIT /NOMESSAGE /ERROR=LOOP /TIME=5 "Username:" !same as above but no display
-
-
- USER10: !Label for switchboard example
-
- WRITE HOST "''user_name'" !Send user_name value
-
- PASS: !Label for timeout routine
-
- label = "pass" !Update label for timeout routine
-
- WAIT /ERROR=LOOP /TIME=5 "Password:" !Waits 5 seconds for the "Password"
- ! prompt. (Place your pass prompt here)
-
- ! WAIT /NOMESSAGE /ERROR=LOOP /TIME=5 "Password:" !same as above but no display
-
- WRITE HOST "''pass_name'" !Send pass_name value
-
- GOTO EXIT !Go to the EXIT label
-
- !-----------------
- ! END OF ROUTINE |
- !-----------------
-
- !----------------------------------------
- ! The following lines are executed |
- ! if a timeout occurred. |
- ! (We try 3 times before giving up) |
- !----------------------------------------
-
- LOOP: !Label if timeout expired
-
- WRITE HOST !Send another carriage return
-
- COUNT = COUNT + 1 !Increment count
-
- IF COUNT .lt. 3 THEN GOTO 'label' !Loop to label if haven't tried 3 times
-
- COUNT = 0 !Reset count
-
- DISPLAY /STATUS "Error occurred waiting for prompt."
- !Display error message on status line
-
- INQUIRE /STATUS TEMP "Do you wish to try waiting again? (Y/N) "
- !Prompt if want to try again
-
- IF (TEMP .eqs. "Y") .or. (TEMP .eqs. "y") THEN GOTO 'label'
- !If yes, goto either USER or PASS
-
- GOTO EXIT !Go to the EXIT label
-
- !----------------------------------------
- ! The following lines are executed |
- ! if the connection wasn't established. |
- !----------------------------------------
-
- PROBLEM: !Label for if problem occurred in wait
-
- DISPLAY /STATUS "Error occurred trying to connect."
- !Display error message on status line
-
- INQUIRE /STATUS TEMP "Do you wish to try connecting again? (Y/N) "
- !Prompt if want to try again
-
- IF (TEMP .eqs. "Y") .or. (TEMP .eqs. "y") THEN GOTO BEGIN
- !If yes, goto label BEGIN
-
- !----------------------------------------
- ! EXIT ROUTINE |
- ! (sends a carriage return then leaves) |
- !----------------------------------------
-
- EXIT: !Exit label
-
- WRITE HOST !Send a carriage return
-
- EXIT !Exit the command file
-