#! /tools/bin/perl

require '/usr/www/push/common20.pl';

my $www_machine=shift;
my $webdir="/usr/local/webdev";
my $sourcedir="/usr/www/push/temp/src/apache_1.3.12/conf/epinions.conf";
##################################################
my $ssh="/tools/bin/ssh";

&stop_start_webdev(stop);
sleep 10;
&stop_start_webdev(start);

sub stop_start_webdev
{
my $command=shift;
if ($command eq "stop"){
	$cmd="$ssh root\@$www_machine \" cd $webdir; ./stop \" ";
	print "$cmd\n";
	&ssh_pipe($cmd);
#	$cmd="cd $sourcedir; scp -C cmtool.conf domainRewriteRules.conf host_config httpd.conf make_entity_map.pl make_host_conf.pl newsletterRewriteRules.conf redirects1.0.conf startup-env.sh bd\@$www_machine:$webdir/conf";
#	print "$cmd\n";
#	&ssh_pipe($cmd);
#	$cmd="$ssh bd\@$www_machine \" cd $webdir/conf; ./make_host_conf.pl \" ";
#	print "$cmd\n";
#	&ssh_pipe($cmd);
} elsif ($command eq "start") {
	$cmd="$ssh root\@$www_machine \"cd $webdir; ./start \" ";
	print "$cmd\n";
	&ssh_pipe($cmd);
} # End of if
} # End of stop_start_webdev
