Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2013
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. @rem = '--*-Perl-*--
  2. @echo off
  3. if exist .\perl\perl\bin\perl.exe goto perlexefound
  4. echo.
  5. echo ERROR: Can not find .\perl\bin\perl.exe
  6. echo This installation is incomplete.
  7. echo Make sure that the downloaded file is complete.
  8. echo Make sure that your unzip pogram extracts subdirectories
  9. echo and preserves long filenames.
  10. echo.
  11. goto endofperl
  12.  
  13. :perlexefound
  14. .\perl\perl\bin\perl -w -T -I.\perl\perl\lib run.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
  15. goto endofperl
  16. @rem ';
  17. #!perl -w
  18. #################################################################
  19. #
  20. # script to execute tinyweb webserver and run TWiki
  21. #
  22. #################################################################
  23.  
  24. @rem = (); # eliminate warning
  25.  
  26. use Cwd;
  27. use strict;
  28.  
  29. print "\nThis script executes the tinyweb webserver service and launches the TWiki homepage\n\n";
  30. print "Environment variable PERLLIB is set to $ENV{PERLLIB}\n\n" if $ENV{PERLLIB};
  31. print "Environment variable PER5LLIB is set to $ENV{PERL5LIB}\n\n" if $ENV{PERL5LIB};
  32.  
  33. my $cwd = Cwd::cwd();
  34. open( BATCH, ">$cwd/tools/start.bat" ) or die "Can't create $cwd/tools/start.bat";
  35. $cwd =~ s/\//\\/;
  36. print BATCH "\@REM Auto-generated by run.bat, do not modify\n";
  37. print BATCH "cd $cwd\\logs\n";
  38. print BATCH "start $cwd\\tinyweb\\tinyweb.exe $cwd\\htdocs 8765 127.0.0.1 .pl $cwd\\perl\\perl\\bin\\perl.exe -T\n";
  39. print BATCH "start $cwd\\tools\\start.url\n";
  40. close( BATCH );
  41. exec( "$cwd\\tools\\start.bat" );
  42.  
  43. #chdir( './logs' );
  44. #system( 'start', '$cwd.'\tinyweb\tinyweb.exe', $cwd.'\htdocs', '8765', '127.0.0.1', '.pl', $cwd.'\perl\perl\bin\perl.exe' );
  45. #my $cmd= 'start '.$cwd.'\tinyweb\tinyweb.exe '.$cwd.'\htdocs 8765 127.0.0.1 .pl '.$cwd.'\perl\perl\bin\perl.exe';
  46. #print "cmd: $cmd\n";
  47. #`$cmd`;
  48. #print "exec: $cwd\twiki.url\n";
  49. #exec( $cwd.'\twiki.url' );
  50.  
  51. __END__
  52. :endofperl
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement