首页 > 科技 > Patch apply

Patch apply

2006年12月3日 12点17分 发表评论 阅读评论

# $errnum = system(“$config{‘update_system_cmd’} $install_file doit_in_foreground >/dev/null 2>&1”);
#`echo Start install parameters – update.cgi – force install:$force_install >> /tmp/gui.dbg`;

my $TMP_LOG = “/tmp/tmp_install_patch.log”;
`echo “” > $TMP_LOG`;
my $cmd_out = system(“$config{‘update_system_cmd’} $install_file $force_install install 1>/dev/null 2>$TMP_LOG &”);
print qq(
);
print qq(

);

my $ps = 0;
my $pat = “Patching the system OS software under maintenance mode!”;
my $line_num = 1;
my $lines;
while(!$ps){
`ps -aef | grep SYS_InstallStartOSInstall | grep -v grep`;
$ps = $?;
my @var = `sed -n ‘$line_num,$p’ $TMP_LOG | grep -v DBG | sed s/^[][]*/”

“/`;
foreach $vv(@var){
if($vv=~m/$pat/){
print qq(

);;
$pat_line = `cat -n $TMP_LOG | wc -l`;
$line_num = $pat_line + 1;
}
elsif(defined $pat_line){
if(not $vv=~m/^&/ and not $vv=~m/error/ and not $vv=~m/arning/){
print qq(

);
$lines = `cat -n $TMP_LOG | wc -l`;
$line_num = $lines + 1;
}
}
else{
$lines = `cat -n $TMP_LOG | wc -l`;
$line_num = $lines + 1;
}
}
sleep 0.1;
}

print qq(

Patch Apply

$vv
$vv

);
`cat $TMP_LOG >> $INSTALL_LOG`;
my $sta = grep /Succeed/, $TMP_LOG;
button_table_start();

if(!$sta){
# print “sta=$stan”;
print “Patch install successfully, please reboot your systemn”;
print qq(


n);
print qq(

);
write_action_button(“reboot”,$software_26,”javascript:document.rebootForm.submit()”);
print qq(
);
exit 0;
}
else{
print “Install failedn”;
write_action_button(“back”,”<< $software_10","index.cgi"); print "sta=$stan"; exit 0; } button_table_end(); `rm -rf $TMP_LOG`;

分类: 科技 标签:
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.
您必须在 登录 后才能发布评论.