Fixed all volume group run

Howdy,

Fixed the handling for "all" volume groups.
Added in handling for UNKNOWN status and exiting with a fair error message in that case.


Later.
On 07/01/2014 03:53 PM, veverjak wrote:
>
> In check_vg_size:
>
> > @@ -85,7 +85,7 @@ checkArgValidity () {
> >
> >  #Does volume group actually exist?
> >  volumeGroupExists () {
> > -	local volGroup=$1
> > +	local volGroup=${@}
>
> Finally got it :) Its apparently too late for me.
> I've added some quotes that should solved the problem.
>
> Thanks for bug fixing.
> Please let me know if you want to enhance/redesign this old code ;) I 
> am glad someone finds it useful
>
> J.
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/veverjak/check_vg_size/pull/6/files#r14428445>.
>

Hello,

---
  #Does volume group actually exist?
  volumeGroupExists () {
-       local volGroup="$1"
+       local volGroup=$1
----


Putting the quotes in above doesn't help, needs to be in the call to 
volumeGroupExists() to make sure it's one parameter. If spaces are 
included in unquoted strings passed to functions, bash treats the spaces 
as a separator for parameters.

So, sample showing difference:

wcarlson@blade:/tmp$ cat sample.sh
#!/bin/bash

isitright() {
     one="$1"
     echo "$one"
}

isitright wrong no
isitright "wrong no"
wcarlson@blade:/tmp$ ./sample.sh
wrong
wrong no

Versus this:

wcarlson@blade:/tmp$ cat sample.sh
#!/bin/bash

isitright() {
     one=$@
     echo "$one"
}

isitright wrong no
isitright "wrong no"
wcarlson@blade:/tmp$ ./sample.sh
wrong no
wrong no


Later,

-- 
Bill Carlson

Anything is possible, given Time and Money.