cat /bin/mycvs #!/bin/bash ssh -p 9000 $* #end #### #!/usr/bin/perl #use strict; #)-: use CGI qw/:standard/; # configure my $cvspasswd = 'not_config_yet'; my $project = 'asd'; if(!defined($ENV{'CVSROOT'})) { $ENV{'CVSROOT'}=':ext:asdasd@192.168.0.5:/home/export/cvsroot'; } if(!defined($ENV{'CVS_RSH'})) { $ENV{'CVS_RSH'}='/bin/mycvs'; } my $cvs ="cvs"; if (-e '/usr/bin/cvs') { $cvs="/usr/bin/cvs"; } # HTML PAGE my $page = new CGI; print $page->header(), $page->start_html("xxx"), $page->h1("xx"), $page->hr(), $page->h2("cvs commands"), $page->startform, $page->radio_group(-name =>'cmd', -values =>['checkout','checkin','commit'], -define =>'no', -linkbreak =>'true'), $page->submit("run","GO!"), $page->endform; # run cvs cmd if(param()){ my $cvscmd = param('cmd'); if($cvscmd == 'checkout') { print "Checking out, ples wait ...\n\n";# why always go here ????? }elsif(($cvscmd == 'checkin') ||($cvscmd == 'commit')) { print "$cvscmd is disabled now !"; exit 1; }else{ die "What are u doing?\n"; } die "can not open pipe: $!" unless defined(my $pid=open(DOCVS,"|$cvs $cvscmd $project")); $SIG{'PIPE'} = sub{ die "$cvs pipe broken";}; if ($pid) { my @pipere = ; my $line = join(/\n/,@pipere); $line =~s/\s//g; if ($line=~/yes\/no/) { print DOCVS 'yes'; }elsif($line=~/pass/){ print DOCVS $cvspasswd; } @pipere=();$line=""; @pipere=; for $line (@pipere) { print "$line"; } } } $page->end_html();