Bugfixing quota_get for LVM partition ( again ) need testing
This commit is contained in:
parent
d7101646ba
commit
d10c673dd8
|
@ -39,21 +39,24 @@ if [ -z "$QUOTA_PART" ]; then
|
|||
UUID=$( $BLKID | grep "$QUOTA_PART" | cut -f2 -s -d" " | sed 's/\(UUID="\)\(.*\)\(\"$\)/\2/')
|
||||
fi
|
||||
|
||||
#We check that quotas are activated on the right partition
|
||||
quot=$(sudo quota -A -wg "$MID" | awk 'NR==3 { print $1; }')
|
||||
part=$( $BLKID | grep "$quot" | cut -f2 -s -d" " | sed 's/\(UUID="\)\(.*\)\(\"$\)/\2/')
|
||||
|
||||
# If the quotas are activated on another part we return 0 meaning that the quotas are infinite
|
||||
if [ "$UUID" != "$part" ]; then
|
||||
echo -e "0\n0"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Now we get the quota
|
||||
#first by testing if the partition is referenced by UUID
|
||||
val=$(sudo quota -A -wg "$MID" |grep "$UUID" | awk '{ print $2 "\n" $3; }')
|
||||
if [ -z "$val" ] ; then
|
||||
val=$(sudo quota -A -wg "$MID" |grep "$QUOTA_PART" | awk '{ print $2 "\n" $3; }')
|
||||
|
||||
# If the quota aren't activated, I return something anyway
|
||||
if [ -z "$val" ] ; then
|
||||
echo -e "0\n0"
|
||||
else
|
||||
echo -e "0\n0"
|
||||
fi
|
||||
val=$(sudo quota -A -wg "$MID" | awk 'NR==3 { print $2 "\n" $3; }')
|
||||
|
||||
if [ -z "$val" ] ; then
|
||||
# If the quota aren't activated, I return something anyway
|
||||
if [ "$UUID" != "$part" ]; then
|
||||
echo -e "0\n0"
|
||||
fi
|
||||
else
|
||||
echo -e "$val"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue