您的位置:首页 >> Web开发 >> CGI技术 >> 正文
CGI技术 RSS
 

系统比对[oscmp.pl]

http://www.rdxx.com 07年11月30日 23:11 我要投稿

关键词: SCM , 系统 , CMP

  #!/usr/bin/perl -w

###########################################################################
# Global definitions
###########################################################################
use Getopt::Long;

$tmpdir="/usr/tmp/integrit.$$";
$usrtmp="/usr/tmp/integrit_tmp.$$";
$filedir="$tmpdir/filedir";
$integrit_conf="$tmpdir/integrit.conf";
$integrit="/usr/local/sbin/integrit";
$knowndb="/tmp/tsecdb";
$remcurrentdb="/tmp/databases/integrit.cdb.new";
$currentdb="/tmp/databases";
$remdb="/tmp/tsecdb/integrit.cdb";
$inststuff="/ccrun/etc/inststuff.pl";

###########################################################################
#command
###########################################################################

#$scp="/usr/bin/scp";
#$ssh="/usr/local/bin/ssh";
#$rsync="/usr/bin/rsync";
#$integrit="/usr/bin/integrit";

$scp="/usr/local/bin/scp";
$ssh="/usr/local/bin/ssh";
$rsync="/usr/local/bin/rsync";
$integrit="/usr/local/sbin/integrit";
$rsync_cmd="$rsync -Rapzq --partial -e $ssh";
$rsync_del="$rsync -lvrnc --delete -e $ssh";
$rsync_exist="$rsync -lvrnc --existing -e $ssh";

###########################################################################
# Check for help request. Display help page if --help/-h/-? was passed.
###########################################################################
sub help_page {
my $programname = $0;
$programname =~ s#^\./##;
print("$programname - .\
Usage: $programname <-r hostname>[-i Ign]\
Options are interpreted as follows:\
-r hostname remote hostname\
-i Ign Ignores default setting.\

For example: \
$programname -r enghp3\n");
exit 1;
}


###########################################################################
# Check and update local configuration
###########################################################################
sub LocalVarExists ($)
{
my ($name) = @_;
return $main::{$name}; # if integrit_conf declared it, we're done.
}

my $newstuff = "";
sub LocalVar ($$)
{
my ($name, $definition) = @_;
return if $main::{$name};
$newstuff .= " " . $name;
open FILE, '>>', $integrit_conf;
print FILE $definition, "\n\n";
close FILE;
}


###########################################################################
# Check data directory
###########################################################################
sub Checkdir()
{

#Check tmp directory
unless (-d $tmpdir)
{
print "Creating tmp directory ($tmpdir) ...\n";
mkdir $tmpdir, 0770;
}

unless (-d $usrtmp)
{
print "Creating tmp directory ($usrtmp) ...\n";
mkdir $usrtmp, 0770;
}


unless (-d $knowndb)
{
print "Creating knowndb directory ($knowndb) ...\n";
mkdir $knowndb, 0770;
}


#unless (-d $datadir) {
# print "Creating data directory ($datadir) ...\n";
# mkdir $datadir, 0770;
#}

###########################################################################
#create integrit.conf
###########################################################################

unless (-e $integrit_conf){

LocalVar('root_dir', <<'END');
# integrit.conf -*- fundamental -*-
#

root=/
END

LocalVar('database', <<'END');
known=/tmp/tsecdb/integrit.cdb
current=/tmp/databa

共5页  第1页 第2页 第3页 第4页 第5页


 
 
标签: SCM , 系统 , CMP 打印本文
 
 
  热点搜索
 
 
 



Valid XHTML 1.0 Transitional
Copyright ©2005 - 2008 Rdxx.Com,All Rights Reserved
收藏本页
收藏本站