fix ( script : remove tee)

This commit is contained in:
Missing 2024-07-26 17:09:35 +08:00
parent 5026475542
commit 355daa739e
6 changed files with 26 additions and 26 deletions

@ -36,11 +36,11 @@ pre_check(){
if [ -f $LOCAL_CNT_FILE ];then if [ -f $LOCAL_CNT_FILE ];then
echo "Local cnt file exist ..." >> /dev/null echo "Local cnt file exist ..." >> /dev/null
else else
echo "Local cnt file doesn't exist, so creat it ..." | tee $LOG_FILE echo "Local cnt file doesn't exist, so creat it ..."
echo 1 > $LOCAL_CNT_FILE echo 1 > $LOCAL_CNT_FILE
fi fi
echo "---------------------------------------------" | tee $LOG_FILE echo "---------------------------------------------"
#Todo if need check something #Todo if need check something
@ -51,7 +51,7 @@ start_ac_cycle(){
local_cnt=`cat $LOCAL_CNT_FILE` local_cnt=`cat $LOCAL_CNT_FILE`
if [ $local_cnt -le $aim_cnt ];then if [ $local_cnt -le $aim_cnt ];then
echo "Index $local_cnt : will execute machine AC cycle" | tee $LOG_FILE echo "Index $local_cnt : will execute machine AC cycle"
local_cnt=$(($local_cnt+1)) local_cnt=$(($local_cnt+1))
echo $local_cnt > $LOCAL_CNT_FILE echo $local_cnt > $LOCAL_CNT_FILE

@ -36,11 +36,11 @@ pre_check(){
if [ -f $LOCAL_CNT_FILE ];then if [ -f $LOCAL_CNT_FILE ];then
echo "Local cnt file exist ..." >> /dev/null echo "Local cnt file exist ..." >> /dev/null
else else
echo "Local cnt file doesn't exist, so creat it ..." | tee $LOG_FILE echo "Local cnt file doesn't exist, so creat it ..."
echo 1 > $LOCAL_CNT_FILE echo 1 > $LOCAL_CNT_FILE
fi fi
echo "---------------------------------------------" | tee $LOG_FILE echo "---------------------------------------------"
#Todo if need check something #Todo if need check something
@ -51,7 +51,7 @@ start_dc_cycle(){
local_cnt=`cat $LOCAL_CNT_FILE` local_cnt=`cat $LOCAL_CNT_FILE`
if [ $local_cnt -le $aim_cnt ];then if [ $local_cnt -le $aim_cnt ];then
echo "Index $local_cnt : will execute power cycle" | tee $LOG_FILE echo "Index $local_cnt : will execute power cycle"
local_cnt=$(($local_cnt+1)) local_cnt=$(($local_cnt+1))
echo $local_cnt > $LOCAL_CNT_FILE echo $local_cnt > $LOCAL_CNT_FILE

@ -36,12 +36,12 @@ print_usage(){
pre_check(){ pre_check(){
# check if local cnt file exist # check if local cnt file exist
echo "---------------------------------------------" | tee $LOG_FILE echo "---------------------------------------------"
#Todo if need check something #Todo if need check something
ipmitool mc info | tee $LOG_FILE ipmitool mc info
if [ $? -ne 0 ];then if [ $? -ne 0 ];then
echo ">>> BMC Die, script terminated ..." | tee $LOG_FILE echo ">>> BMC Die, script terminated ..."
exit 0 exit 0
fi fi
} }
@ -52,7 +52,7 @@ start_stress_update(){
while true while true
do do
cnt=$(($cnt+1)) cnt=$(($cnt+1))
echo ">>> start test index $cnt" | tee $LOG_FILE echo ">>> start test index $cnt"
pre_check pre_check
@ -62,16 +62,16 @@ start_stress_update(){
else else
use_image=$image1 use_image=$image1
fi fi
echo ">>> Use Image : $use_image" | tee $LOG_FILE echo ">>> Use Image : $use_image"
# start update # start update
$YAFU -cd $use_image -pc | tee $LOG_FILE $YAFU -cd $use_image -pc
echo ">>> End of update , start sleep 600s ..." | tee $LOG_FILE echo ">>> End of update , start sleep 600s ..."
if [ $cnt -le $aim_cnt ];then if [ $cnt -le $aim_cnt ];then
sleep $sleep_time sleep $sleep_time
else else
echo ">>> Complete stress update, Exit ..." | tee $LOG_FILE echo ">>> Complete stress update, Exit ..."
break break
fi fi
done done

@ -36,11 +36,11 @@ pre_check(){
if [ -f $LOCAL_CNT_FILE ];then if [ -f $LOCAL_CNT_FILE ];then
echo "Local cnt file exist ..." >> /dev/null echo "Local cnt file exist ..." >> /dev/null
else else
echo "Local cnt file doesn't exist, so creat it ..." | tee $LOG_FILE echo "Local cnt file doesn't exist, so creat it ..."
echo 1 > $LOCAL_CNT_FILE echo 1 > $LOCAL_CNT_FILE
fi fi
echo "---------------------------------------------" | tee $LOG_FILE echo "---------------------------------------------"
#Todo if need check something #Todo if need check something
@ -51,7 +51,7 @@ start_os_reboot(){
local_cnt=`cat $LOCAL_CNT_FILE` local_cnt=`cat $LOCAL_CNT_FILE`
if [ $local_cnt -le $aim_cnt ];then if [ $local_cnt -le $aim_cnt ];then
echo "Index $local_cnt : will execute reboot" | tee $LOG_FILE echo "Index $local_cnt : will execute reboot"
sleep 1 sleep 1

@ -34,7 +34,7 @@ print_usage(){
# } # }
pre_check(){ pre_check(){
echo "---------------------------------------------" | tee $LOG_FILE echo "---------------------------------------------"
#Todo if need check something #Todo if need check something
@ -48,16 +48,16 @@ start_ac_cycle(){
cnt=$(($cnt+1)) cnt=$(($cnt+1))
pre_check pre_check
echo ">>> start test index $cnt, will perform AC cycle" | tee $LOG_FILE echo ">>> start test index $cnt, will perform AC cycle"
ipmitool -I lanplus -H $bmcip -U $username -P $password raw 0x3c 0x28 0xff 0xfc | tee $LOG_FILE ipmitool -I lanplus -H $bmcip -U $username -P $password raw 0x3c 0x28 0xff 0xfc
sleep 10 sleep 10
ipmitool -I lanplus -H $bmcip -U $username -P $password raw 0x3c 0x28 0xff 0xfd | tee $LOG_FILE ipmitool -I lanplus -H $bmcip -U $username -P $password raw 0x3c 0x28 0xff 0xfd
if [ $cnt -le $aim_cnt ];then if [ $cnt -le $aim_cnt ];then
sleep 180 sleep 180
else else
echo ">>> Complete test , will exit ..." | tee $LOG_FILE echo ">>> Complete test , will exit ..."
break; break;
fi fi

@ -34,7 +34,7 @@ print_usage(){
# } # }
pre_check(){ pre_check(){
echo "---------------------------------------------" | tee $LOG_FILE echo "---------------------------------------------"
#Todo if need check something #Todo if need check something
@ -48,14 +48,14 @@ start_dc_cycle(){
cnt=$(($cnt+1)) cnt=$(($cnt+1))
pre_check pre_check
echo ">>> start test index $cnt, will perform power cycle" | tee $LOG_FILE echo ">>> start test index $cnt, will perform power cycle"
ipmitool -I lanplus -H $bmcip -U $username -P $password power cycle | tee $LOG_FILE ipmitool -I lanplus -H $bmcip -U $username -P $password power cycle
if [ $cnt -le $aim_cnt ];then if [ $cnt -le $aim_cnt ];then
sleep 120 sleep 120
else else
echo ">>> Complete test , will exit ..." | tee $LOG_FILE echo ">>> Complete test , will exit ..."
break; break;
fi fi