# dip-script -- used with RHS netcfg for SLIP, CSLIP, and PPP
#
# Version:        0.1
#
# Author:         Fred N. van Kempen
# Modified:       Marc Ewing for Red Hat Software

main:
  get $local @@@local-ip@@@
  get $remote @@@remote-ip@@@

  port modem
  speed @@@modem-speed@@@

  reset

  # You may need to send some modem set-up string here

  send ATDT@@@phone-number@@@\r
  wait CONNECT 45
  if $errlvl != 0 goto error

  # You may need to change \n to \r\n

login:
  # You may not need this sleep
  sleep 3
  # You'll need to set this "ogin:" to match the login
  # string of the host you are dailing
  wait ogin: 10
  if $errlvl != 0 goto error
  send @@@login-id@@@\n
  if $errlvl != 0 goto error
  # Same here, for the password
  wait ord: 10
  if $errlvl != 0 goto error
  send @@@password@@@\n
  wait @@@connect-string@@@ 30
  if $errlvl != 0 goto error

loggedin:
  get $mtu @@@mtu@@@
  default

done:
  print CONNECTED to $remote with address $rmtip
  mode @@@connection-type@@@
  exit

error:
  print @@@connection-type@@@ to $remote failed.
