#!/bin/bash

# Version 2.1.5
# 15/08/2014
# Add: judge the run environment of the MM , if not then exit,else run this shell.
 

# Version 1.0.4
# 20140516
# Add : tar cvzf $mypath/common.tar.gz  /common/*
# Add:  root@SMM:/tmp# /smm/get_one_touch_info.sh  all
#

# Version 1.0.3
# 20140511
# Add smmget -l fan/ps -d sel 

# Version 1.0.2
# This used only for Huawei Tecal Server MM.
# Used For : MM610
#            MM620
#            MM910
# Test by Myself only MM610/MM620/MM910, and Need more server for test. 


# 20140113 version 1.0.2
# add collect NEMA1/A2/B1/B2/C1/C2 sel information to LOG_001

# 20131224 version 1.0.1
# add common/flash/var compress information to LOG_007

# 20131224 version 1.0.0
# For Test;

# 20131220 version 0.0.1
# Reference ZHANGYIXIN infoCollect.sh, add collect information


# 20131219 version 0.0.1
# The first Version. If you have question please send mail to dingshiqiang@huawei.com, and I will discuss to you if need to add.    


# Judeg the running environment if MM ,if not then exit, else run this shell.  20140815

MM_Env=$(smmget 2>/dev/null )
if [ ! -n "$MM_Env" ];then
	echo
	echo -en '\E[47;31m'"\033[1m This is not a SMM  environment,and exit NOW!       \033[0m"
	echo 
	echo -en '\E[47;31m'"\033[1m Please put this shell into SMM /tmp,and run again! \033[0m"
	echo 
	echo 
	exit
else
	echo
	echo -en '\E[47;34m'"\033[1m Begin to collect SMM information and will need several minutes. \033[0m" 
	echo 
fi


rm -rf /tmp/collect
rm -rf /tmp/*MM*.tar.gz
rm -rf /tmp/one_touch_info_all

mypath="/tmp/collect"

if [ -e "${mypath}" ]; then
    collect_date=$(date +"%Y-%m-%d_%H_%M_%S")
    mypath="/tmp/collect_${collect_date}"
    if [ -e "${mypath}" ]; then
        exit 1
    fi
fi

mkdir ${mypath}
mkdir ${mypath}/common_flash_var

mypath_common_flash="/tmp/collect/common_flash_var"


MM_name=$(smmget -l smm -t fru -d all |grep "Board Description" |awk -F ": " '{print $2}' |awk -F "." '{print $1}')

echo 
echo
echo "Will be collect flow information of MM Board."


#====================================== For Common Order collect of SMM Begin ================================================#


LOG_001="001_Common_Order_collect_of_SMM.log"

echo 
echo "################ Collect all present version information ; For E6000&E9000 ################" >>$mypath/$LOG_001
echo 
echo >> $mypath/$LOG_001
echo "smmget -l smm -d getallversion"
echo 
echo "root@SMM:/#smmget -l smm -d getallversion" >>$mypath/$LOG_001
smmget -l smm -d getallversion >> $mypath/$LOG_001
echo >> $mypath/$LOG_001

echo 
echo "################ Collect system health ; For E6000&E9000 ################" >>$mypath/$LOG_001
echo 
echo >> $mypath/$LOG_001
echo "smmget -l system -d health"
echo 
echo "root@SMM:/#smmget -l system -d health" >>$mypath/$LOG_001
smmget -l system -d health >> $mypath/$LOG_001
echo >> $mypath/$LOG_001

echo 
echo "################ Collect system unhealthylocations ; For E6000 & E9000 ################" >>$mypath/$LOG_001
echo 
echo >> $mypath/$LOG_001
echo "smmget -l system -d unhealthylocations"
echo 
echo "root@SMM:/#smmget -l system -d unhealthylocations" >>$mypath/$LOG_001
smmget -l system -d unhealthylocations >> $mypath/$LOG_001
echo >> $mypath/$LOG_001

echo 
echo "################ Collect system healthevents ; For E6000 ################" >>$mypath/$LOG_001
echo 
echo >> $mypath/$LOG_001
echo "smmget -l system -d healthevents"
echo 
echo "root@SMM:/#smmget -l system -d healthevents" >>$mypath/$LOG_001
smmget -l system -d healthevents >> $mypath/$LOG_001
echo >> $mypath/$LOG_001
echo " If E9000 Report: The location does not support the operation. Please ignore it! ">> $mypath/$LOG_001
echo >> $mypath/$LOG_001

echo 
echo "################ Collect system healthevents ; For E9000 ################" >>$mypath/$LOG_001
echo 
for i in "smm" "blade1" "blade2" "blade3" "blade4" "blade5" "blade6" "blade7" "blade8" "blade9" "blade10" "blade11" "blade12" "blade13" "blade14" "blade15" "blade16" "swi1" "swi2" "swi3" "swi4" "shelf" "pem" "fantray"
do
echo 
echo >> $mypath/$LOG_001
echo "smmget -l $i -d healthevents"
echo 
echo "root@SMM:/#smmget -l $i -d healthevents" >>$mypath/$LOG_001
smmget -l $i -d healthevents >> $mypath/$LOG_001
echo >> $mypath/$LOG_001
done 
echo >> $mypath/$LOG_001
echo " If E6000 Report: smmget:cli invalid location or data length error./smmget [-h] [-l location] [-t target] -d dataitem from Blade11. Please ignore it! ">> $mypath/$LOG_001
echo >> $mypath/$LOG_001

echo 
echo "################ Collect mm swi pem fantray sel  ; smm for E6000&E9000,NEMA1/A2/B1/B2/C1/C2/fan/ps for E6000 and others for E9000 ################" >>$mypath/$LOG_001
echo >> $mypath/$LOG_001

for i in "smm" "NEMA1" "NEMA2" "NEMB1" "NEMB2" "NEMC1" "NEMC2" "fan" "ps" "swi1" "swi2" "swi3" "swi4" "pem" "fantray"
do
	echo "smmget -l $i -d sel"
	echo 
	echo "root@SMM:/#smmget -l $i -d sel" >>$mypath/$LOG_001
	echo |smmget -l $i -d sel >> $mypath/$LOG_001
done
echo >> $mypath/$LOG_001


echo "################ Collect Blade Sel ; For E6000&E9000 ################" >>$mypath/$LOG_001

echo >> $mypath/$LOG_001
echo "For E6000 Blade is From 1 TO 10" >>$mypath/$LOG_001
echo "For E9000 Blade is From 1 TO 16" >>$mypath/$LOG_001

for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
do
	echo "smmget -l blade$i -d sel"
	echo 
	echo "root@SMM:/#smmget -l blade$i -d sel" >>$mypath/$LOG_001
	echo |smmget -l blade$i -d sel >> $mypath/$LOG_001
	
	echo "smmget -l blade$i -d bmcsel"
	echo 
	echo "root@SMM:/#smmget -l blade$i -d bmcsel" >>$mypath/$LOG_001
	echo |smmget -l blade$i -d bmcsel >> $mypath/$LOG_001
	
done
echo >> $mypath/$LOG_001

#====================================== For Common Order collect of SMM End  =================================================#



#====================================== For MM Order collect of SMM Begin ================================================#


LOG_002="002_MM_Order_collect_of_SMM.log"

echo 
echo "################ Collect MM redundancy ; For E6000&E9000 ################" >>$mypath/$LOG_002
echo 
echo >> $mypath/$LOG_002
echo "smmget -d redundancy"
echo 
echo "root@SMM:/#smmget -d redundancy" >>$mypath/$LOG_002
smmget -d redundancy >> $mypath/$LOG_002
echo >> $mypath/$LOG_002
echo >> $mypath/$LOG_002
echo " If E9000 Report: The dataitem input does not exist. Please ignore it! ">> $mypath/$LOG_002
echo >> $mypath/$LOG_002

echo 
echo "################ Collect MM operatelog ; For E6000 ################" >>$mypath/$LOG_002
echo 
echo >> $mypath/$LOG_002
echo "smmget -d operatelog"
echo 
echo "root@SMM:/#smmget -d operatelog" >>$mypath/$LOG_002
echo | smmget -d operatelog >> $mypath/$LOG_002
echo >> $mypath/$LOG_002


echo 
echo "################ Collect MM SNMP Set ; For E6000 & E9000 ################" >>$mypath/$LOG_002
echo 
echo >> $mypath/$LOG_002
echo "smmget -l smm -d snmptrapenable"
echo 
echo "root@SMM:/#smmget -l smm -d snmptrapenable" >>$mypath/$LOG_002
smmget -l smm -d snmptrapenable >> $mypath/$LOG_002

echo "smmget -l smm -d snmptrapversion"
echo 
echo "root@SMM:/#smmget -l smm -d snmptrapversion" >>$mypath/$LOG_002
smmget -l smm -d snmptrapversion >> $mypath/$LOG_002

echo "smmget -l smm -d snmptrapport"
echo 
echo "root@SMM:/#smmget -l smm -d snmptrapport" >>$mypath/$LOG_002
smmget -l smm -d snmptrapport >> $mypath/$LOG_002

echo "smmget -l smm -d snmptrapcommunity"
echo 
echo "root@SMM:/#smmget -l smm -d snmptrapcommunity" >>$mypath/$LOG_002
smmget -l smm -d snmptrapcommunity >> $mypath/$LOG_002

for i in 1 2 3 4 5
do
	echo "smmget -l smm -d snmptrapaddress$i"
	echo 
	echo "root@SMM:/#smmget -l smm -d snmptrapaddress$i" >>$mypath/$LOG_002
	smmget -l smm -d snmptrapaddress$i >> $mypath/$LOG_002
done
echo >> $mypath/$LOG_002


echo 
echo "################ Collect poweroninterval Set ; For E9000 ################" >>$mypath/$LOG_002
echo >> $mypath/$LOG_002
echo 
echo "smmget  -l smm  -d poweroninterval"
echo 
echo "root@SMM:/#smmget  -l smm  -d poweroninterval" >>$mypath/$LOG_002
smmget  -l smm  -d poweroninterval >> $mypath/$LOG_002
echo >> $mypath/$LOG_002
echo " If E6000 Report: The dataitem input does not exist. Please ignore it! ">> $mypath/$LOG_002
echo >> $mypath/$LOG_002

#====================================== For MM Order collect of SMM End  =================================================#


#====================================== Blade order information collect of SMM Begin ================================================#

LOG_003="003_E9000_Blade_Order_collect_of_SMM.log"

echo "################ Collect Blade information for : realtimepower/powercapping/powerreference/resetreason/diskboardpresence/systemInformation ; For E9000 ################" >>$mypath/$LOG_003
echo >> $mypath/$LOG_003

for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
do
	for j in "realtimepower" "powercapping" "powerreference" "resetreason" "diskboardpresence" "systemInformation"
	do
		echo "smmget -l blade$i -d $j"
		echo 
		echo >> $mypath/$LOG_003
		echo "root@SMM:/#smmget -l blade$i -d $j" >>$mypath/$LOG_003
		smmget -l blade$i -d $j >> $mypath/$LOG_003
		echo >> $mypath/$LOG_003
		echo -e " If E6000 Report: \n The dataitem input does not exist.\n smmget:cli invalid location or data length error \n smmget [-h] [-l location] [-t target] -d dataitem. \n Please ignore it! ">> $mypath/$LOG_003
		echo >> $mypath/$LOG_003
	done		
done
echo >> $mypath/$LOG_003

#====================================== Blade order information collect of SMM End  ================================================#

#====================================== For PS/FAN/shelf collect of SMM Begin ================================================#


LOG_004="004_E6000_E9000_MM_Collect_PS_FAN_shelf_information.log"

echo 
echo "################ Collect PS and FAN ; For E6000 ################" >>$mypath/$LOG_004
echo 
echo >> $mypath/$LOG_004
echo "smmget -l ps -d power"
echo 
echo "root@SMM:/#smmget -l ps -d power" >>$mypath/$LOG_004
smmget -l ps -d power >> $mypath/$LOG_004
echo >> $mypath/$LOG_004

echo 
echo >> $mypath/$LOG_004
echo "smmget -l fan -d fanlevel"
echo 
echo "root@SMM:/#smmget -l fan -d fanlevel" >>$mypath/$LOG_004
smmget -l fan -d fanlevel >> $mypath/$LOG_004
echo >> $mypath/$LOG_004

echo >> $mypath/$LOG_004
echo -e " If E9000 Report: \n smmget:cli invalid location or data length error \n smmget [-h] [-l location] [-t target] -d dataitem. \n Please ignore it! ">> $mypath/$LOG_004
echo >> $mypath/$LOG_004

echo >>$mypath/$LOG_004
echo "***************************************************************************************************" >>$mypath/$LOG_004
echo >>$mypath/$LOG_004

echo 
echo "################ Collect PS and FAN ; For E9000 ################" >>$mypath/$LOG_004
echo >> $mypath/$LOG_004
echo -e " If E6000 Report: \n smmget:cli invalid location or data length error \n smmget [-h] [-l location] [-t target] -d dataitem. \n Please ignore it! ">> $mypath/$LOG_004
echo >> $mypath/$LOG_004


echo >>$mypath/$LOG_004
echo "PS: runtimepower/pemtype/ratingpower"   >>$mypath/$LOG_004
echo >>$mypath/$LOG_004

for i in "runtimepower"  "pemtype" "ratingpower"
do
	echo >> $mypath/$LOG_004
	echo "smmget -l shelf -d $i"
	echo 
	echo "root@SMM:/#smmget -l shelf -d $i" >>$mypath/$LOG_004
	smmget -l shelf -d $i >> $mypath/$LOG_004
	echo >> $mypath/$LOG_004
done


echo "FAN:  fanspeed/fanframetype/fancontrolmode"   >>$mypath/$LOG_004
echo >>$mypath/$LOG_004

for i in "fanspeed" "fanframetype" "fancontrolmode"
do
	echo 
	echo >> $mypath/$LOG_004
	echo "smmget -l shelf -d $i"
	echo 
	echo "root@SMM:/#smmget -l shelf -d $i" >>$mypath/$LOG_004
	smmget -l shelf -d $i >> $mypath/$LOG_004
	echo >> $mypath/$LOG_004
done

echo 
echo "################ Collect shelf power information ; For E9000 ################" >>$mypath/$LOG_004
echo >> $mypath/$LOG_004
echo -e " If E6000 Report: \n smmget:cli invalid location or data length error \n smmget [-h] [-l location] [-t target] -d dataitem. \n Please ignore it! ">> $mypath/$LOG_004
echo >> $mypath/$LOG_004

echo >>$mypath/$LOG_004
echo "shelf:  realtimepower/powercappingenable/powercapping"   >>$mypath/$LOG_004
echo >>$mypath/$LOG_004

for i in "realtimepower" "powercappingenable" "powercapping"
do
	echo 
	echo >> $mypath/$LOG_004
	echo "smmget -l shelf -d $i"
	echo 
	echo "root@SMM:/#smmget -l shelf -d $i" >>$mypath/$LOG_004
	smmget -l shelf -d $i >> $mypath/$LOG_004
	echo >> $mypath/$LOG_004
done

#====================================== For PS/FAN/shelf collect of SMM End  =================================================#



#====================================== For Sensor collect of SMM Begin ================================================#

LOG_005="005_MM_Collect_Sensor_information.log"

echo 
echo "################ Collect Sensor ; For E6000 & E9000 ################" >>$mypath/$LOG_005

for i in "Inlet temp" "Flash Usage" "FailOver"
do
	echo 
	echo >> $mypath/$LOG_005
	echo "smmget -l smm -t $i -d current"
	echo 
	echo "root@SMM:/#smmget -l smm -t $i -d current" >>$mypath/$LOG_005
	smmget -l smm -t $i -d current >> $mypath/$LOG_005
	echo >> $mypath/$LOG_005
done

echo >> $mypath/$LOG_005
echo -e " If E9000 Report: (About FailOver) \n The target does not exist, or the target does not support the dataitem. \n Please ignore it! ">> $mypath/$LOG_005
echo >> $mypath/$LOG_005

#====================================== For Sensor Order collect of SMM End  ===========================================#


#====================================== Copy /common/ and /flash file Begin == For MM910 AND MM620 ================================================#

common_log="common/log"
mkdir -p $mypath_common_flash/$common_log
cp -r /$common_log/* $mypath_common_flash/$common_log/

common_flash_var_log="common/flash/var/log"
mkdir -p $mypath_common_flash/$common_flash_var_log
cp -r /$common_flash_var_log/* $mypath_common_flash/$common_flash_var_log/

common_var_log="common/var/log"
mkdir -p $mypath_common_flash/$common_var_log
cp -r /$common_var_log/messages* $mypath_common_flash/$common_var_log/
cp -r /$common_var_log/dmesg* $mypath_common_flash/$common_var_log/
cp -r /$common_var_log/.bash_history $mypath_common_flash/$common_var_log/

common_usr_local_snmp_share_snmp="common/usr/local/snmp/share/snmp"
mkdir -p $mypath_common_flash/$common_usr_local_snmp_share_snmp
cp -r /$common_usr_local_snmp_share_snmp/snmpd.conf $mypath_common_flash/$common_usr_local_snmp_share_snmp/
cp -r /$common_usr_local_snmp_share_snmp/.snmpdbak.conf $mypath_common_flash/$common_usr_local_snmp_share_snmp/

common_apache_logs="common/apache/logs"
mkdir -p $mypath_common_flash/$common_apache_logs
cp -r /$common_apache_logs/*log $mypath_common_flash/$common_apache_logs/

common_var_net_snmp="common/var/net-snmp"
mkdir -p $mypath_common_flash/$common_var_net_snmp
cp -r /$common_var_net_snmp/* $mypath_common_flash/$common_var_net_snmp/

flash="flash"
mkdir -p $mypath_common_flash/$flash
cp -r /$flash/smmnetip.cfg $mypath_common_flash/$flash/

flash_smmdir_usr_local_smm="flash/smmdir/usr/local/smm"
mkdir -p $mypath_common_flash/$flash_smmdir_usr_local_smm
cp -r /$flash_smmdir_usr_local_smm/SMM.CFG $mypath_common_flash/$flash_smmdir_usr_local_smm/

var_log="var/log"
mkdir -p $mypath_common_flash/$var_log
cp -r /$var_log/* $mypath_common_flash/$var_log/

           
#====================================== Copy /common/ and /flash file End  ===========================================#

#====================================== Add for E9000 Begin ================================================#

LOG_006="006_System_infor_last-reboot_ifconfig-a_netstat-napl_ps-aux_free_df_history_dhcp_update.log"

echo 
echo "################ Sytem infor: last reboot/ifconfig -a/netstat -napl/ps aux/free/df/history ; For E6000 & E9000 ################" >>$mypath/$LOG_006
echo >> $mypath/$LOG_006

echo "root@SMM:/#last reboot" >>$mypath/$LOG_006
last reboot >> $mypath/$LOG_006
echo >> $mypath/$LOG_006

echo "root@SMM:/#ifconfig -a" >>$mypath/$LOG_006
ifconfig -a >> $mypath/$LOG_006
echo >> $mypath/$LOG_006

echo "root@SMM:/#lnetstat -napl" >>$mypath/$LOG_006
netstat -napl >> $mypath/$LOG_006
echo >> $mypath/$LOG_006

echo "root@SMM:/#ps aux" >>$mypath/$LOG_006
ps aux >> $mypath/$LOG_006
echo >> $mypath/$LOG_006

echo "root@SMM:/#free" >>$mypath/$LOG_006
free >> $mypath/$LOG_006
echo >> $mypath/$LOG_006

echo "root@SMM:/#df" >>$mypath/$LOG_006
df >> $mypath/$LOG_006
echo >> $mypath/$LOG_006

echo "root@SMM:/#history" >>$mypath/$LOG_006
history >> $mypath/$LOG_006
echo >> $mypath/$LOG_006




echo >>$mypath/$LOG_006
echo "***************************************************************************************************" >>$mypath/$LOG_006
echo >>$mypath/$LOG_006

echo
echo "**********************************************************************************************************"
echo


echo "################ Sytem infor: dhcp/update ; For E6000 & E9000 ################" >>$mypath/$LOG_006
echo >> $mypath/$LOG_006
echo "If the information is NULL,Mybe the dhcp not set. Please ignore it!">> $mypath/$LOG_006
echo >> $mypath/$LOG_006

echo "root@SMM:/#cat /flash/smmdhcp.cfg " >>$mypath/$LOG_006
cat /flash/smmdhcp.cfg >> $mypath/$LOG_006
echo >> $mypath/$LOG_006

echo "root@SMM:/#cat /common/var/dhcp/dhclient.leases" >>$mypath/$LOG_006
cat /common/var/dhcp/dhclient.leases >> $mypath/$LOG_006
echo >> $mypath/$LOG_006


echo "root@SMM:/#cat /common/var/run/dhclient.pid" >>$mypath/$LOG_006
cat /common/var/run/dhclient.pid >> $mypath/$LOG_006
echo >> $mypath/$LOG_006

echo "root@SMM:/#cat /tmp/updateflag/accesslog" >>$mypath/$LOG_006
cat /tmp/updateflag/accesslog >> $mypath/$LOG_006
echo >> $mypath/$LOG_006

echo "root@SMM:/#cat /tmp/updateexitcode" >>$mypath/$LOG_006
cat /tmp/updateexitcode >> $mypath/$LOG_006
echo >> $mypath/$LOG_006

echo "root@SMM:/#cat /tmp/updateprocess/rbf_process" >>$mypath/$LOG_006
cat /tmp/updateprocess/rbf_process >> $mypath/$LOG_006
echo >> $mypath/$LOG_006


echo "root@SMM:/#cat /tmp/updateprocess/boot_process" >>$mypath/$LOG_006
cat /tmp/updateprocess/boot_process >> $mypath/$LOG_006
echo >> $mypath/$LOG_006

echo "root@SMM:/#cat /tmp/updateprocess/cramfs_process" >>$mypath/$LOG_006
cat /tmp/updateprocess/cramfs_process >> $mypath/$LOG_006
echo >> $mypath/$LOG_006

echo "root@SMM:/#cat /tmp/updateprocess/vme_process" >>$mypath/$LOG_006
cat /tmp/updateprocess/vme_process >> $mypath/$LOG_006
echo >> $mypath/$LOG_006

echo "root@SMM:/#cat /tmp/updateprocess/webhelp" >>$mypath/$LOG_006
cat /tmp/updateprocess/webhelp >> $mypath/$LOG_006
echo >> $mypath/$LOG_006

echo 
echo "If report Error,Please don't care,the dhcp and update mybe haven't information!"
echo

echo
echo "**********************************************************************************************************"
echo

#====================================== Add for E9000 End  ===========================================#

LOG_007="007_MM_Collect_date_time_and_Compress_log.log"

echo
echo "################ Compress the Collect MM Information. ################" 
echo 

Board_Name=$(smmget -l smm -t fru -d all |grep "Board Description" |awk -F ": " '{print $2}' |awk -F "." '{print $1}')
#echo $Board_Name

case $Board_Name in
	"BC01SMMA" ) MM_Name="MM610" ;;
	"BC01SMMB" ) MM_Name="MM620" ;;
	"IT11SMMA" ) MM_Name="MM910" ;;
	* ) echo "Not find the MM board name!" ;;
esac

#echo "$MM_Name"
echo 




Board_SN=$(smmget -l smm -t fru -d all |grep "Board Serial Number" |awk -F ": " '{print $2}' |awk '{print $1}' )
#echo $Board_SN

collect_date=$(date +"%Y-%m-%d_%H-%M-%S")
echo "################ Collect information date and time ################" >> $mypath/$LOG_007
echo >> $mypath/$LOG_007
echo "$collect_date" >> $mypath/$LOG_007
echo >> $mypath/$LOG_007

echo >> $mypath/$LOG_007
echo "################ Compress log ################" >> $mypath/$LOG_007
echo >> $mypath/$LOG_007
cd $mypath

echo >> $mypath/$LOG_007
echo "root@SMM:/tmp/collect#tar cvzf common_flash_var.tar.gz common_flash_var/*">> $mypath/$LOG_007
tar cvzf common_flash_var.tar.gz common_flash_var/* 2>/dev/null >> $mypath/$LOG_007


# collect /common/* all file and compress;
echo >> $mypath/$LOG_007
echo "root@SMM:/tmp/collect#tar cvzf common.tar.gz /common/*">> $mypath/$LOG_007				
tar cvzf common.tar.gz /common/* 2>/dev/null >> $mypath/$LOG_007

#  collec /smm/get_one_touch_info.sh  all   
echo >> $mypath/$LOG_007
echo "This Only For E9000 and if E6000 report some information please ignore it."  >> $mypath/$LOG_007
echo "/smm/get_one_touch_info.sh  all"
echo 
echo >> $mypath/$LOG_007
echo "root@SMM:/tmp/collect#/smm/get_one_touch_info.sh  all"  >> $mypath/$LOG_007
echo "Please wait for a monment. This will take about 3 Mins" 
/smm/get_one_touch_info.sh  all   2>/dev/null >> $mypath/$LOG_007
mv /tmp/one_touch_info_all/* ./
rm -rf /tmp/one_touch_info_all
echo
echo "This Only For E9000 and if E6000 report some information please ignore it."
echo  

cd /
rm -rf $mypath_common_flash

tar cvzf /tmp/"$MM_Name"_"$Board_Name"_"$Board_SN"_"$collect_date".tar.gz $mypath/ 2>/dev/null  
rm -rf $mypath

echo	
echo "################  SMM Collect End!  ################"


echo
echo "################ ll /tmp/ file ################" 
ls -l /tmp/
echo

echo

echo "################ Please get out the /tmp/"$MM_Name"_"$Board_Name"_"$Board_SN"_"$collect_date".tar.gz file and then Delete it in MM /tmp . ################"
echo
echo