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/')
|
UUID=$( $BLKID | grep "$QUOTA_PART" | cut -f2 -s -d" " | sed 's/\(UUID="\)\(.*\)\(\"$\)/\2/')
|
||||||
fi
|
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
|
# Now we get the quota
|
||||||
#first by testing if the partition is referenced by UUID
|
val=$(sudo quota -A -wg "$MID" | awk 'NR==3 { print $2 "\n" $3; }')
|
||||||
val=$(sudo quota -A -wg "$MID" |grep "$UUID" | awk '{ print $2 "\n" $3; }')
|
|
||||||
if [ -z "$val" ] ; then
|
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 the quota aren't activated, I return something anyway
|
||||||
if [ -z "$val" ] ; then
|
if [ "$UUID" != "$part" ]; then
|
||||||
echo -e "0\n0"
|
echo -e "0\n0"
|
||||||
else
|
|
||||||
echo -e "0\n0"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
echo -e "$val"
|
echo -e "$val"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue