Skip to content

Commit

Permalink
Merge pull request #8 from RainbowHackerHorse/bugfix/dupe--list
Browse files Browse the repository at this point in the history
Fix --list duplication
  • Loading branch information
RainbowHackerHorse authored Dec 19, 2017
2 parents dc0051b + 44f62d9 commit e6c5bf2
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions vzvol
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,11 @@ getargz() {

# Display Data
vzvol_list() {
vzvol_list_type 2>&1 /dev/null
vzvol_pre_list 2>&1 /dev/null
if [ $? = 2 ]; then
echo "Error, No zvols Configured"
exit 1
fi
vzvol_list_type 2>&1 /dev/null
vzvol_pre_list 2>&1 /dev/null
if [ $? = 0 ]; then
(printf "ZVOL TYPE VMDK USED SIZE FS \n" \
; vzvol_list_type) | column -t
Expand All @@ -293,9 +292,18 @@ vzvol_list() {
return 1
fi
}
vzvol_pre_list(){
list_my_vols=$( zfs list -t volume | awk '!/NAME/ {print $1}' )
if [ "$list_my_vols" = "no" ]; then
return 2
else
return 0
fi
}
vzvol_list_type() {
list_my_vols=$( zfs list -t volume | awk '!/NAME/ {print $1}' )
if [ "$list_my_vols" = "no" ]; then
echo "Error, No zvols Configured"
return 2
fi
for vols in $list_my_vols; do
Expand Down

0 comments on commit e6c5bf2

Please sign in to comment.