2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-20 02:00:24 +00:00

modify code according to weihua's comments

This commit is contained in:
junxiawang
2015-08-27 09:40:23 -04:00
parent e9557f4c0c
commit dff634afdf

View File

@@ -314,7 +314,9 @@ sub mn_install {
system("xdsh $confkeys{$mn} \"iptables -A FORWARD -i eth1 -j ACCEPT\" >/dev/null 2>&1");
system("xdsh $confkeys{$mn} \"iptables -A FORWARD -i eth1 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT\" >/dev/null 2>&1");
}
if($os =~ /rhels7/){
system("xdsh $confkeys{$mn} \"yum -y install bzip2 > /var/log/xcat/install_xcat.log 2>&1\" >/dev/null 2>&1");
}
return 0;
}
@@ -330,19 +332,18 @@ sub down_dep{
my $deplink;
if (! -f "$downxcatdepdir/curlhtml1"){
send_msg(2, "it is first time to down xcatdep");
` curl "$curllink" |grep "xcat-dep-" > "$downxcatdepdir/curlhtml1" `;
` curl "$curllink/" |grep "xcat-dep-" > "$downxcatdepdir/curlhtml1" `;
` tail -1 "$downxcatdepdir/curlhtml1" > "$downxcatdepdir/curlfile"`;
$deplink = `cat "$downxcatdepdir"/"curlfile" |awk '{print \$6}' |sed 's/"/ /g' |awk '{print \$2}' `;
print "deplink is $deplink\n";
$deplink = `cat "$downxcatdepdir"/"curlfile" |awk '{print \$6}' |sed 's/"/ /g' |awk '{print \$2}' `;
`mkdir -p $xcatdepdir/$mn`;
` wget -P "$xcatdepdir/$mn" -c $curllink$deplink `;
` wget -P "$xcatdepdir/$mn" -c $curllink/$deplink `;
if($?){
send_msg(0, "download xcatdep failed");
return 1;
}
$depupdateflag=1;
}else{
`curl "$curllink" |grep "xcat-dep-" > "$downxcatdepdir/curlhtml1" `;
`curl "$curllink/" |grep "xcat-dep-" > "$downxcatdepdir/curlhtml2" `;
` diff "$downxcatdepdir"/"curlhtml1" "$downxcatdepdir"/"curlhtml2"`;
if ($?==0) {
send_msg(2, "no update for xcatdep ");
@@ -350,10 +351,9 @@ sub down_dep{
}else{
` tail -1 "$downxcatdepdir"/"curlhtml2"> "$downxcatdepdir"/"curlfile"`;
$deplink = `cat "$downxcatdepdir"/"curlfile" |awk '{print \$6}' |sed 's/"/ /g' |awk '{print \$2}' `;
print "deplink is $deplink\n";
` rm -rf $xcatdepdir/$mn`;
`mkdir -p $xcatdepdir/$mn`;
` wget -P "$xcatdepdir/$mn" -c $curllink$deplink `;
` wget -P "$xcatdepdir/$mn" -c $curllink/$deplink `;
if($?){
send_msg(2, "download xcatdep failed");
return 1;