ppp-on-rsh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/bin/sh
  2. #
  3. # A sample script to establish PPP session(s) via rsh
  4. #
  5. # Adi Masputra <adi.masputra@sun.com>
  6. # Jan 24, 2000
  7. #
  8. #
  9. # You'd definitely want to change the following addresses to suit
  10. # your network configuration
  11. #
  12. LOC_IP=10.0.0.1
  13. REM_IP=10.0.0.2
  14. NETMASK=255.255.0.0
  15. export LOC_IP REM_IP
  16. #
  17. # This is the remote peer where in.rshd is running, either
  18. # its hostname or IP address
  19. #
  20. PPPD_RHOST=myremotehost
  21. #
  22. # For this example, we assume that pppd on both local and remote
  23. # machines reside in the same place, /usr/local/bin/pppd
  24. #
  25. PPPD_LOC=/usr/local/bin/pppd
  26. #
  27. # The location of local options file (where rsh client is running).
  28. # Note that the sample options file included in the distribution
  29. # may need further customizations, depending on your needs. The 'noauth'
  30. # option specified in the file is there to simplify the example. In
  31. # reality, you'd probably want to remove such option.
  32. #
  33. PPPD_LOC_OPT=/etc/ppp/options-rsh-loc
  34. #
  35. # The location of remote options file (where in.rshd daemon is running).
  36. # Note that the sample options file included in the distribution
  37. # may need further customizations, depending on your needs. The 'noauth'
  38. # option specified in the file is there to simplify the example. In
  39. # reality, you'd probably want to remove such option. Also note that
  40. # the remote options file need to include the 'notty' option for this
  41. # to work
  42. #
  43. PPPD_REM_OPT=/etc/ppp/options-rsh-rem
  44. #
  45. # The location of rsh client on the local machine
  46. #
  47. RSH_LOC=/bin/rsh
  48. export PPPD_LOC PPPD_LOC_OPT PPPD_REM_OPT PPPD_RHOST RSH_LOC
  49. #
  50. # Uncomment the following to enable IPv6, note that the IPv6 support
  51. # needs to be enabled during compilation
  52. #
  53. # PPPD_IPV6='+ipv6 ipv6cp-use-ipaddr'
  54. export PPPD_IPV6
  55. #
  56. # And execute pppd with the pty option, specifying rsh client as the
  57. # slave side of the pseduo-tty master/slave pair.
  58. #
  59. exec $PPPD_LOC \
  60. pty '$RSH_LOC $PPPD_RHOST $PPPD_LOC $REM_IP:$LOC_IP $PPPD_IPV6 file $PPPD_REM_OPT' \
  61. $LOC_IP:$REM_IP netmask $NETMASK $PPPD_IPV6 file $PPPD_LOC_OPT