diff options
Diffstat (limited to 'swift-storage.configure')
-rw-r--r-- | swift-storage.configure | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/swift-storage.configure b/swift-storage.configure index f410bea6..078a8390 100644 --- a/swift-storage.configure +++ b/swift-storage.configure @@ -20,9 +20,13 @@ set -e export ROOT="$1" validate_number() { - if ! echo -n "$2" | grep -xq '[0-9]\+' + local name="$1" + local value="$2" + + local pattern='[0-9]+' + if ! [[ "$value" =~ $pattern ]] then - echo "'$1' must be a number" >&2 + echo "'$name' must be a number" >&2 exit 1 fi } |