fix ( script : all) 修复 is_param_legal合法性校验
This commit is contained in:
parent
972b3dbec4
commit
c552fa321c
@ -24,12 +24,12 @@ print_usage(){
|
|||||||
echo "Format: ./inband_ac_cycle.sh [cnt] &"
|
echo "Format: ./inband_ac_cycle.sh [cnt] &"
|
||||||
}
|
}
|
||||||
|
|
||||||
is_param_legal(){
|
# is_param_legal(){
|
||||||
if [ $# -ne $PARAM_NUM ];then
|
# if [ $# -ne $PARAM_NUM ];then
|
||||||
print_usage
|
# print_usage
|
||||||
exit 0
|
# exit 0
|
||||||
fi
|
# fi
|
||||||
}
|
# }
|
||||||
|
|
||||||
pre_check(){
|
pre_check(){
|
||||||
# check if local cnt file exist
|
# check if local cnt file exist
|
||||||
@ -67,7 +67,10 @@ start_ac_cycle(){
|
|||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
# The start of script
|
# The start of script
|
||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
is_param_legal
|
if [ $# -ne $PARAM_NUM ];then
|
||||||
|
print_usage
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
pre_check
|
pre_check
|
||||||
|
|
||||||
|
|||||||
@ -24,12 +24,12 @@ print_usage(){
|
|||||||
echo "Format: ./inband_dc_cycle.sh [cnt] &"
|
echo "Format: ./inband_dc_cycle.sh [cnt] &"
|
||||||
}
|
}
|
||||||
|
|
||||||
is_param_legal(){
|
# is_param_legal(){
|
||||||
if [ $# -ne $PARAM_NUM ];then
|
# if [ $# -ne $PARAM_NUM ];then
|
||||||
print_usage
|
# print_usage
|
||||||
exit 0
|
# exit 0
|
||||||
fi
|
# fi
|
||||||
}
|
# }
|
||||||
|
|
||||||
pre_check(){
|
pre_check(){
|
||||||
# check if local cnt file exist
|
# check if local cnt file exist
|
||||||
@ -63,8 +63,10 @@ start_dc_cycle(){
|
|||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
# The start of script
|
# The start of script
|
||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
is_param_legal
|
if [ $# -ne $PARAM_NUM ];then
|
||||||
|
print_usage
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
pre_check
|
pre_check
|
||||||
|
|
||||||
start_dc_cycle
|
start_dc_cycle
|
||||||
@ -27,12 +27,12 @@ print_usage(){
|
|||||||
echo "Format : ./inband_stress_update.sh [cnt] [image1] [image2]"
|
echo "Format : ./inband_stress_update.sh [cnt] [image1] [image2]"
|
||||||
}
|
}
|
||||||
|
|
||||||
is_param_legal(){
|
# is_param_legal(){
|
||||||
if [ $# -ne $PARAM_NUM ];then
|
# if [ $# -ne $PARAM_NUM ];then
|
||||||
print_usage
|
# print_usage
|
||||||
exit 0
|
# exit 0
|
||||||
fi
|
# fi
|
||||||
}
|
# }
|
||||||
|
|
||||||
pre_check(){
|
pre_check(){
|
||||||
# check if local cnt file exist
|
# check if local cnt file exist
|
||||||
@ -80,6 +80,9 @@ start_stress_update(){
|
|||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
# The start of script
|
# The start of script
|
||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
is_param_legal
|
if [ $# -ne $PARAM_NUM ];then
|
||||||
|
print_usage
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
start_stress_update
|
start_stress_update
|
||||||
@ -24,12 +24,12 @@ print_usage(){
|
|||||||
echo "Format: ./os_reboot.sh [cnt] &"
|
echo "Format: ./os_reboot.sh [cnt] &"
|
||||||
}
|
}
|
||||||
|
|
||||||
is_param_legal(){
|
# is_param_legal(){
|
||||||
if [ $# -ne $PARAM_NUM ];then
|
# if [ $# -ne $PARAM_NUM ];then
|
||||||
print_usage
|
# print_usage
|
||||||
exit 0
|
# exit 0
|
||||||
fi
|
# fi
|
||||||
}
|
# }
|
||||||
|
|
||||||
pre_check(){
|
pre_check(){
|
||||||
# check if local cnt file exist
|
# check if local cnt file exist
|
||||||
@ -65,7 +65,10 @@ start_os_reboot(){
|
|||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
# The start of script
|
# The start of script
|
||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
is_param_legal
|
if [ $# -ne $PARAM_NUM ];then
|
||||||
|
print_usage
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
pre_check
|
pre_check
|
||||||
|
|
||||||
|
|||||||
@ -26,12 +26,12 @@ print_usage(){
|
|||||||
echo "Format: ./outband_ac_cycle.sh [cnt] [BMC ip] [user] [passwd] &"
|
echo "Format: ./outband_ac_cycle.sh [cnt] [BMC ip] [user] [passwd] &"
|
||||||
}
|
}
|
||||||
|
|
||||||
is_param_legal(){
|
# is_param_legal(){
|
||||||
if [ $# -ne $PARAM_NUM ];then
|
# if [ $# -ne $PARAM_NUM ];then
|
||||||
print_usage
|
# print_usage
|
||||||
exit 0
|
# exit 0
|
||||||
fi
|
# fi
|
||||||
}
|
# }
|
||||||
|
|
||||||
pre_check(){
|
pre_check(){
|
||||||
echo "---------------------------------------------" | tee $LOG_FILE
|
echo "---------------------------------------------" | tee $LOG_FILE
|
||||||
@ -67,6 +67,8 @@ start_ac_cycle(){
|
|||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
# The start of script
|
# The start of script
|
||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
is_param_legal
|
if [ $# -ne $PARAM_NUM ];then
|
||||||
|
print_usage
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
start_ac_cycle
|
start_ac_cycle
|
||||||
@ -26,12 +26,12 @@ print_usage(){
|
|||||||
echo "Format: ./outband_dc_cycle.sh [cnt] [BMC ip] [user] [passwd] &"
|
echo "Format: ./outband_dc_cycle.sh [cnt] [BMC ip] [user] [passwd] &"
|
||||||
}
|
}
|
||||||
|
|
||||||
is_param_legal(){
|
# is_param_legal(){
|
||||||
if [ $# -ne $PARAM_NUM ];then
|
# if [ $# -ne $PARAM_NUM ];then
|
||||||
print_usage
|
# print_usage
|
||||||
exit 0
|
# exit 0
|
||||||
fi
|
# fi
|
||||||
}
|
# }
|
||||||
|
|
||||||
pre_check(){
|
pre_check(){
|
||||||
echo "---------------------------------------------" | tee $LOG_FILE
|
echo "---------------------------------------------" | tee $LOG_FILE
|
||||||
@ -65,6 +65,9 @@ start_dc_cycle(){
|
|||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
# The start of script
|
# The start of script
|
||||||
# ----------------------------------------------------
|
# ----------------------------------------------------
|
||||||
is_param_legal
|
if [ $# -ne $PARAM_NUM ];then
|
||||||
|
print_usage
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
start_dc_cycle
|
start_dc_cycle
|
||||||
Loading…
Reference in New Issue
Block a user