fix ( script : all) 修复 is_param_legal合法性校验

This commit is contained in:
Missing 2024-07-15 16:56:47 +08:00
parent 972b3dbec4
commit c552fa321c
6 changed files with 60 additions and 44 deletions

@ -24,12 +24,12 @@ print_usage(){
echo "Format: ./inband_ac_cycle.sh [cnt] &"
}
is_param_legal(){
if [ $# -ne $PARAM_NUM ];then
print_usage
exit 0
fi
}
# is_param_legal(){
# if [ $# -ne $PARAM_NUM ];then
# print_usage
# exit 0
# fi
# }
pre_check(){
# check if local cnt file exist
@ -67,7 +67,10 @@ start_ac_cycle(){
# ----------------------------------------------------
# The start of script
# ----------------------------------------------------
is_param_legal
if [ $# -ne $PARAM_NUM ];then
print_usage
exit 0
fi
pre_check

@ -24,12 +24,12 @@ print_usage(){
echo "Format: ./inband_dc_cycle.sh [cnt] &"
}
is_param_legal(){
if [ $# -ne $PARAM_NUM ];then
print_usage
exit 0
fi
}
# is_param_legal(){
# if [ $# -ne $PARAM_NUM ];then
# print_usage
# exit 0
# fi
# }
pre_check(){
# check if local cnt file exist
@ -63,8 +63,10 @@ start_dc_cycle(){
# ----------------------------------------------------
# The start of script
# ----------------------------------------------------
is_param_legal
if [ $# -ne $PARAM_NUM ];then
print_usage
exit 0
fi
pre_check
start_dc_cycle

@ -27,12 +27,12 @@ print_usage(){
echo "Format : ./inband_stress_update.sh [cnt] [image1] [image2]"
}
is_param_legal(){
if [ $# -ne $PARAM_NUM ];then
print_usage
exit 0
fi
}
# is_param_legal(){
# if [ $# -ne $PARAM_NUM ];then
# print_usage
# exit 0
# fi
# }
pre_check(){
# check if local cnt file exist
@ -80,6 +80,9 @@ start_stress_update(){
# ----------------------------------------------------
# The start of script
# ----------------------------------------------------
is_param_legal
if [ $# -ne $PARAM_NUM ];then
print_usage
exit 0
fi
start_stress_update

@ -24,12 +24,12 @@ print_usage(){
echo "Format: ./os_reboot.sh [cnt] &"
}
is_param_legal(){
if [ $# -ne $PARAM_NUM ];then
print_usage
exit 0
fi
}
# is_param_legal(){
# if [ $# -ne $PARAM_NUM ];then
# print_usage
# exit 0
# fi
# }
pre_check(){
# check if local cnt file exist
@ -65,7 +65,10 @@ start_os_reboot(){
# ----------------------------------------------------
# The start of script
# ----------------------------------------------------
is_param_legal
if [ $# -ne $PARAM_NUM ];then
print_usage
exit 0
fi
pre_check

@ -26,12 +26,12 @@ print_usage(){
echo "Format: ./outband_ac_cycle.sh [cnt] [BMC ip] [user] [passwd] &"
}
is_param_legal(){
if [ $# -ne $PARAM_NUM ];then
print_usage
exit 0
fi
}
# is_param_legal(){
# if [ $# -ne $PARAM_NUM ];then
# print_usage
# exit 0
# fi
# }
pre_check(){
echo "---------------------------------------------" | tee $LOG_FILE
@ -67,6 +67,8 @@ start_ac_cycle(){
# ----------------------------------------------------
# The start of script
# ----------------------------------------------------
is_param_legal
if [ $# -ne $PARAM_NUM ];then
print_usage
exit 0
fi
start_ac_cycle

@ -26,12 +26,12 @@ print_usage(){
echo "Format: ./outband_dc_cycle.sh [cnt] [BMC ip] [user] [passwd] &"
}
is_param_legal(){
if [ $# -ne $PARAM_NUM ];then
print_usage
exit 0
fi
}
# is_param_legal(){
# if [ $# -ne $PARAM_NUM ];then
# print_usage
# exit 0
# fi
# }
pre_check(){
echo "---------------------------------------------" | tee $LOG_FILE
@ -65,6 +65,9 @@ start_dc_cycle(){
# ----------------------------------------------------
# The start of script
# ----------------------------------------------------
is_param_legal
if [ $# -ne $PARAM_NUM ];then
print_usage
exit 0
fi
start_dc_cycle