home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / BBS / SLPSHTTL.ZIP / STARTNET < prev   
AmigaDOS Script File  |  1995-04-15  |  3KB  |  114 lines

  1. .key IP,HN/K,DEST/K,MASK/K,GW/K,USER/K,SRV/S,BOOTP/S,UMASK/K,S2CF/K,S2OPT/K,IFACE/K,DEBUG/S
  2. .bra {
  3. .ket }
  4.  
  5. ; This is a standard starnet script. ***** You MUST set HN and USER *****
  6.  
  7. ;
  8. ; AmiTCP/IP startnet script
  9. ;
  10. ; Copyright ⌐ 1994 AmiTCP/IP Group,
  11. ;                  NSDi - Network Solutions Development Inc., Finland
  12. ;                  All rights reserved.
  13. ;
  14. ; *NOTE*  NORMALLY YOU SHOULD USE THE PROVIDED CONFIGURATION UTILITY
  15. ; *NOTE*  TO CHANGE THE CONFIGURATION.  IF YOU NEED TO CHANGE THE 
  16. ; *NOTE*  CONFIGURATION MANUALLY, RESTRICT ANY MODIFICATIONS TO THIS 
  17. ; *NOTE*  "DEF" SECTION.
  18. ;
  19. ; IP address if known, _nothing_ otherwise
  20. .def IP
  21. ; Our full host name and aliases if known, _nothing_ otherwise
  22. ; (if this is set, the IP _must_ be set, too)
  23. .def HN    "foo.bar"
  24. ; The destination address, needed only if GW is not good destination
  25. .def DEST  
  26. ; netmask if known, _nothing_ otherwise
  27. .def MASK  255.255.255.0
  28. ; IP address of the default gateway if known, _nothing_ otherwise
  29. .def GW
  30. ; Default login name
  31. .def USER
  32. ; User's file creation mask
  33. .def UMASK 022
  34. ; "SRV" if servers are used, _nothing_ otherwise
  35. .def SRV   SRV
  36. ; "BOOTP" if bootstrap protocol is used, _nothing_ otherwise
  37. .def BOOTP 
  38. ; Interface name
  39. .def IFACE cslip0
  40. ; Sana-II device configuration file, _nothing_ otherwise
  41. .def S2CF  cslip0.config
  42. ; Sana-II device configuration to be stored into the configuration file
  43. .def S2OPT "serial.device 0 19200 0.0.0.0 MTU=1006 7WIRE EOFMODE"
  44. ;
  45. ; *NOTE*  YOU SHOULD NOT NEED TO EDIT ANYTHING BELOW. IF YOU NEED TO ADD
  46. ; *NOTE*  CONFIGURATIONS OF ADDITIONAL INTERFACES OR TO START UTILITIES,
  47. ; *NOTE*  DO IT IN THE AmiTCP:db/User-Startnet.
  48. ;
  49. ; Set the failat level so that the errors can be handled by the script
  50. FailAt 21
  51. ; Log in
  52. echo
  53. echo login: {USER}
  54. AmiTCP:bin/login -f {USER}
  55. AmiTCP:bin/umask {UMASK}
  56. run AmiTCP:AmiTCP {DEBUG}
  57. WaitForPort AMITCP
  58. If NOT Warn
  59.   ; Create Sana2 configuration file if used
  60.   If NOT X EQ "X{S2CF}"
  61.     ; Assure that ENV:Sana2 exists
  62.     If NOT Exists ENV:Sana2
  63.       MakeDir ENV:Sana2
  64.     EndIf
  65.     ; Create configuration file
  66.     Echo "{S2OPT}" >ENV:Sana2/{S2CF}
  67.   EndIf
  68.   ; Do we need loopback?
  69.   If X EQ "X{SRV}"
  70.     Set LOOPBACK=""
  71.   Else
  72.     Set LOOPBACK="LOOPBACK"
  73.   EndIf
  74.   ; Configure interface
  75.   AmiTCP:bin/bootpconfig {IFACE} IP {IP$*} DEST {DEST$*} MASK {MASK$*} GW {GW$*} $LOOPBACK {BOOTP} {DEBUG}
  76.   If NOT Warn
  77.     If NOT X EQ "X{HN}"
  78.       rx "address AMITCP; 'ADD HOST {IP} {HN}'"
  79.     Else
  80.       If NOT X EQ "X{DEBUG}"
  81.         echo "Quering Name Server for the host name..."
  82.       EndIf
  83.     EndIf
  84.     setenv HOSTNAME `AmiTCP:bin/hostname`
  85.     Assign TCP: Exists >NIL:
  86.     IF Warn
  87.       Mount TCP: from AmiTCP:devs/Inet-Mountlist
  88.     EndIf
  89.     ; Start the internet `super server' if wanted
  90.     If NOT X EQ "X{SRV}"
  91.       If X EQ "X{DEBUG}"
  92.         Run <NIL: >NIL: AmiTCP:bin/inetd
  93.       Else
  94.         Run AmiTCP:bin/inetd {DEBUG}
  95.       EndIf
  96.     EndIf
  97.     ;
  98.     ; Configure any additional interfaces & start utilities in 
  99.     ; AmiTCP:db/User-Startnet
  100.     ;
  101.     If Exists AmiTCP:db/User-Startnet
  102.       Execute AmiTCP:db/User-Startnet
  103.     EndIf
  104.   Else
  105.     Echo Interface {IFACE} configuration failed!
  106.     Echo Stopping AmiTCP
  107.     AmiTCP:bin/stopnet FLUSH
  108.   EndIf
  109. Else
  110.   Echo AmiTCP couldn't be started!
  111. EndIf
  112.  
  113. ; EOF
  114.