home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 31 / CDASC_31_1996_juillet_aout.iso / internet / 4asrv280.zip / LOGIN.CMD < prev    next >
OS/2 REXX Batch file  |  1995-08-25  |  952b  |  58 lines

  1. #
  2. # Foray PPP Server example dialing script.
  3. #
  4.  
  5. #trace on
  6. #
  7. # set up some strings for dialling up
  8. #
  9. if ![load $number]
  10.   if [query $number "Enter your dial up phone number"]
  11.     save $number
  12.   end
  13. end
  14.  
  15. $modemsetup = "&c1&k3"
  16.  
  17. %attempts = 10
  18. #
  19. #
  20. #----------------------------------------------------------
  21. #
  22. # initialize modem
  23. #
  24. output "atz"\13
  25. if ! [input 10 OK\n]
  26.   display "Modem is not responding"\n
  27.   abort
  28. end
  29. #
  30. # setup our modem commands
  31. #
  32. output "at"$modemsetup\13
  33. input 10 OK\n
  34. #
  35. # send phone number
  36. #
  37. %n = 0
  38. repeat
  39.   if %n = %attempts
  40.     display "Too many dial attempts"\n
  41.     abort
  42.   end
  43.   output "atdt"$number\13
  44.   %ok = [input 60 CONNECT]
  45.   %n = %n + 1
  46. until %ok
  47. input 10 \n
  48. #
  49. #  wait till it's safe to send because some modem's hang up
  50. #  if you transmit during the connection phase
  51. #
  52. wait 30 dcd
  53.  
  54. #
  55. # We are finished.
  56. # PPP negotiation with Foray PPP Server begins immediately.
  57. #
  58.