From c552fa321c71c5f657328249731987b78101f745 Mon Sep 17 00:00:00 2001 From: Missing Date: Mon, 15 Jul 2024 16:56:47 +0800 Subject: [PATCH] =?UTF-8?q?fix=20(=20script=20:=20all)=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=20is=5Fparam=5Flegal=E5=90=88=E6=B3=95=E6=80=A7?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 01.stress_script/inband_ac_cycle.sh | 17 ++++++++++------- 01.stress_script/inband_dc_cycle.sh | 18 ++++++++++-------- 01.stress_script/inband_stress_update.sh | 17 ++++++++++------- 01.stress_script/os_reboot.sh | 17 ++++++++++------- 01.stress_script/outband_ac_cycle.sh | 18 ++++++++++-------- 01.stress_script/outband_dc_cycle.sh | 17 ++++++++++------- 6 files changed, 60 insertions(+), 44 deletions(-) diff --git a/01.stress_script/inband_ac_cycle.sh b/01.stress_script/inband_ac_cycle.sh index abb6402..447012d 100644 --- a/01.stress_script/inband_ac_cycle.sh +++ b/01.stress_script/inband_ac_cycle.sh @@ -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 diff --git a/01.stress_script/inband_dc_cycle.sh b/01.stress_script/inband_dc_cycle.sh index 4038eac..c58b839 100644 --- a/01.stress_script/inband_dc_cycle.sh +++ b/01.stress_script/inband_dc_cycle.sh @@ -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 \ No newline at end of file diff --git a/01.stress_script/inband_stress_update.sh b/01.stress_script/inband_stress_update.sh index 994d8ff..de9e95b 100644 --- a/01.stress_script/inband_stress_update.sh +++ b/01.stress_script/inband_stress_update.sh @@ -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 \ No newline at end of file diff --git a/01.stress_script/os_reboot.sh b/01.stress_script/os_reboot.sh index b6fa65d..43bec56 100644 --- a/01.stress_script/os_reboot.sh +++ b/01.stress_script/os_reboot.sh @@ -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 diff --git a/01.stress_script/outband_ac_cycle.sh b/01.stress_script/outband_ac_cycle.sh index d1d61d8..a55f058 100644 --- a/01.stress_script/outband_ac_cycle.sh +++ b/01.stress_script/outband_ac_cycle.sh @@ -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 \ No newline at end of file diff --git a/01.stress_script/outband_dc_cycle.sh b/01.stress_script/outband_dc_cycle.sh index c40144f..a0e517d 100644 --- a/01.stress_script/outband_dc_cycle.sh +++ b/01.stress_script/outband_dc_cycle.sh @@ -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 \ No newline at end of file