From dff634afdf4e58941342584b752733cac62054cf Mon Sep 17 00:00:00 2001 From: junxiawang Date: Thu, 27 Aug 2015 09:40:23 -0400 Subject: [PATCH] modify code according to weihua's comments --- xCAT-server/share/xcat/tools/xCATreg | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xCAT-server/share/xcat/tools/xCATreg b/xCAT-server/share/xcat/tools/xCATreg index c35120937..b4527f958 100644 --- a/xCAT-server/share/xcat/tools/xCATreg +++ b/xCAT-server/share/xcat/tools/xCATreg @@ -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;