home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / networking / amitcp / cp3.lha / ControlPanel / Bin / Postnews < prev    next >
Encoding:
Text File  |  1995-01-24  |  926 b   |  47 lines

  1. /*
  2. ** Postnews Replacement Script
  3. ** GRn Can Now Post News :-)
  4. */
  5.  
  6. Parse arg result
  7. a = 0
  8. art = word(result,1)
  9. art2 = word(result,3)
  10. alreadyinsertedfile = "FALSE"
  11. if art2 ~="" then
  12. do
  13.   call open(file,art,"A")
  14.   call seek(file,0,"B")
  15.   do while ~eof(file)
  16.   if word(line.a,1) == "Subject:" then call insertfile2
  17.   a = a + 1
  18.   line.a = readln(file)
  19.   end
  20.   call close(file)
  21.   art = "t:grn-file"
  22.   call open(file,art,"W")
  23.   call seek(file,0,"B")
  24.   do i = 1 to a
  25.      call writeln(file,line.i)
  26.   end
  27.   call close(file)
  28. end
  29. address command "amitcp:bin/sendmail <" art "-f $USER -t mail2news@$NEWSSERVER"
  30. exit
  31.  
  32. insertfile2:
  33. say "insertingfile"
  34. if alreadyinsertedfile == "FALSE" then
  35. do
  36.   say "insertfile4real"
  37.   call open(file2,art2,"R")
  38.   do while ~eof(file2)
  39.     a = a + 1
  40.     line.a = readln(file2)
  41.   end
  42.   a = a + 1
  43.   line.a = "Postnews Grn Fix V2 - Martin Hunt Jan 1995"
  44.   alreadyinsertedfile = "TRUE"
  45.   call close(file2)
  46. end
  47.