From b6da97890bed4a6f4808c6d03c30904e5d306be2 Mon Sep 17 00:00:00 2001 From: "Y. SREENIVASULU REDDY" Date: Wed, 4 Feb 2015 16:31:53 +0530 Subject: [PATCH] HBASE-12969 Parameter Validation is not there for shell script, local-master-backup.sh and local-regionservers.sh Signed-off-by: Andrew Purtell --- bin/local-master-backup.sh | 6 +++++- bin/local-regionservers.sh | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/local-master-backup.sh b/bin/local-master-backup.sh index 36a70fa965f..f368e4a4d7c 100755 --- a/bin/local-master-backup.sh +++ b/bin/local-master-backup.sh @@ -54,5 +54,9 @@ shift; for i in $* do - run_master $cmd $i + if [[ "$i" =~ ^[0-9]+$ ]]; then + run_master $cmd $i + else + echo "Invalid argument" + fi done diff --git a/bin/local-regionservers.sh b/bin/local-regionservers.sh index e2cea6d12ad..38d9ffc4eaa 100755 --- a/bin/local-regionservers.sh +++ b/bin/local-regionservers.sh @@ -52,5 +52,9 @@ shift; for i in $* do - run_regionserver $cmd $i + if [[ "$i" =~ ^[0-9]+$ ]]; then + run_regionserver $cmd $i + else + echo "Invalid argument" + fi done