@echo 0 ;%%Netcom hosted connection to FIBS.
@rem ****************************************************************************
@rem ****                                                                   *****
@rem ****     Netcom login Script                                           *****
@rem ****          Assumes that user uses the *default* {NetcomN:N} prompt. *****
@rem ****          and that '}' does not appear in the motd                 *****
@rem ****                                                                   *****
@rem ****************************************************************************

@echo "\r\n** Connecting to FIBS via Netcom Host **\r\n"
@board 0

@rem *****************************************************
@rem ***  Dial the Telephone Number                     **
@rem *****************************************************


@rem Execute dial.scr file to dial the telephone number.
<dial.scr


@rem *****************************************************
@rem ***  Execute the login procedure                   **
@rem *****************************************************

@if "%HostLoginName%" != ""
@:RetryLogin
@   if "%NetworkScript%" == "manual.scn"
@       wait "ogin:"   ; If manual network connect, don't prompt or timeout for login
@   else
@       echo "\r\n** Logging in...\r\n"
@       if not @wait "ogin:" 40     ; e.g. "login:", or "Login:" &c.
@           echo "\r\n** Error(netcom.scc): error - Host Login Prompt not received\r\n"
@           send "\r"
@           goto RetryLogin
@       endif
@   endif
@   send "%HostLoginName%\r"
@   if not @wait "\n" 40
@      echo "\r\n** Error(netcom.scc): No response to Host Login Name\r\n"
<
@   endif
@   if "%HostPassword%" != ""
@       if not @wait "assword:" 30  ; e.g. "Password:" or "password:"
@           echo "\r\n** Error(netcom.scc): Host Password prompt not received\r\n"
<
@       endif
@       send "%HostPassword%\r"
@       if not @wait "\n" 40
@           echo "\r\n** Error(netcom.scc): No response to Host Password\r\n"
<
@       endif
@   else
@       rem ** We need to synchronize around the password **
@       echo "\r\n** Automated login script will resume after you enter your password\r\n"
@       if not @wait "assword:" 40
@          echo "\r\n** Error(netcom.scc): Host password prompt not received\r\n"
<
@       endif
@       passwordEntry 1
@       wait "\n" 
@       passwordEntry 0
@   endif ; HostPassword
@else 
@   if "%NetworkScript%" != "manual.scn"  ; No prompts if manual network connect
@       echo "\r\n** Automated login script will resume after login is complete\r\n"
@   endif
@   wait "ogin:"
@   wait "assword:"
@   passwordEntry 1
@   wait "\n"
@   passwordEntry 0
@endif ; HostLoginName

@rem *****************************************************
@rem *** Wait for the command shell prompt             ***
@rem *****************************************************

@echo "\r\n*** Waiting for shell command prompt...\r\n"
@if not @wait "\r{" 40  ; Wait indefinitely
@   echo "\r\n*** Error(netcom.scc): Command shell prompt not found\r\n"
<
@endif


@rem *****************************************************
@rem *** Connect via telnet                            ***
@rem *****************************************************

<telnet.scr


