adding NFS_QUOTA=no to local.sh => default is now to NOT enable NFS-based quota
This commit is contained in:
parent
f5b309aaca
commit
666d485da7
|
@ -132,6 +132,11 @@ ALTERNC_LOGS=""
|
||||||
# Uncomment and complete the following variable to use it instead of ALTERNC_LOGS.
|
# Uncomment and complete the following variable to use it instead of ALTERNC_LOGS.
|
||||||
#ALTERNC_LOGS_ARCHIVE=""
|
#ALTERNC_LOGS_ARCHIVE=""
|
||||||
|
|
||||||
|
# Shall we enable QUOTA over NFS ?
|
||||||
|
# the default is NO, since this dramatically block /usr/lib/alternc/quota* functions
|
||||||
|
# called from the panel. To enable quota-over-NFS, put yes here
|
||||||
|
NFS_QUOTA=no
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
chown root:alterncpanel $CONFIGFILE
|
chown root:alterncpanel $CONFIGFILE
|
||||||
|
@ -165,6 +170,13 @@ EOF
|
||||||
sed -e "$SED_SCRIPT" < $CONFIGFILE > $CONFIGFILE.tmp
|
sed -e "$SED_SCRIPT" < $CONFIGFILE > $CONFIGFILE.tmp
|
||||||
mv -f $CONFIGFILE.tmp $CONFIGFILE
|
mv -f $CONFIGFILE.tmp $CONFIGFILE
|
||||||
|
|
||||||
|
# Add NFS_QUOTA instructions if they are not in the config file:
|
||||||
|
grep -Eq "^ *NFS_QUOTA=" $CONFIGFILE || echo "
|
||||||
|
# Shall we enable QUOTA over NFS ?
|
||||||
|
# the default is NO, since this dramatically block /usr/lib/alternc/quota* functions
|
||||||
|
# called from the panel. To enable quota-over-NFS, put yes here
|
||||||
|
NFS_QUOTA=no" >> $CONFIGFILE
|
||||||
|
|
||||||
# Erase all apacheconf file
|
# Erase all apacheconf file
|
||||||
# They will be regenerated without the bug by upgrade_check.sh below.
|
# They will be regenerated without the bug by upgrade_check.sh below.
|
||||||
if dpkg --compare-versions "$2" le "0.9.3.9-globenet14"; then
|
if dpkg --compare-versions "$2" le "0.9.3.9-globenet14"; then
|
||||||
|
|
|
@ -2,6 +2,7 @@ alternc (3.1.5) oldstable; urgency=low
|
||||||
|
|
||||||
* fix alias changes not working in some cases
|
* fix alias changes not working in some cases
|
||||||
* fix ;;; END ALTERNC zones bug also for older versions
|
* fix ;;; END ALTERNC zones bug also for older versions
|
||||||
|
* fix manage remote NFS-based quota when *explicitely* stated in local.sh (QUOTA_NFS=y)
|
||||||
|
|
||||||
-- Benjamin Sonntag <benjamin@sonntag.fr> Wed, 29 Apr 2015 10:30:01 +0200
|
-- Benjamin Sonntag <benjamin@sonntag.fr> Wed, 29 Apr 2015 10:30:01 +0200
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,12 @@ if [ "x$MID" == "x" ] ; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
QUOTA_OPTIONS="-l"
|
||||||
|
if [ "$NFS_QUOTA" = "yes" -o "$NFS_QUOTA" = "YES" -o "$NFS_QUOTA" = "Yes" ]
|
||||||
|
then
|
||||||
|
QUOTA_OPTIONS=""
|
||||||
|
fi
|
||||||
|
|
||||||
#checking if quotas are installed
|
#checking if quotas are installed
|
||||||
command -v $QUOTA >/dev/null || { echo "Quotas uninstalled"; exit 0; }
|
command -v $QUOTA >/dev/null || { echo "Quotas uninstalled"; exit 0; }
|
||||||
|
|
||||||
|
@ -40,13 +46,13 @@ 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
|
||||||
|
|
||||||
quot=$(sudo quota -wvg "$MID" | grep "$QUOTA_PART" | $AWK 'NR==1 {print $1;}' )
|
quot=$(sudo quota $QUOTA_OPTIONS -wvg "$MID" | grep "$QUOTA_PART" | $AWK 'NR==1 {print $1;}' )
|
||||||
|
|
||||||
# Now we get the quota
|
# Now we get the quota
|
||||||
#first by testing if the partition is referenced by UUID
|
#first by testing if the partition is referenced by UUID
|
||||||
val=$(sudo quota -vwg "$MID" |grep "$UUID" | awk 'END { print $2 "\n" $3; }')
|
val=$(sudo quota $QUOTA_OPTIONS -vwg "$MID" |grep "$UUID" | awk 'END { print $2 "\n" $3; }')
|
||||||
if [ -z "$val" ] ; then
|
if [ -z "$val" ] ; then
|
||||||
val=$(sudo quota -A -wg "$MID" |grep "$QUOTA_PART" | awk 'END { print $2 "\n" $3; }')
|
val=$(sudo quota $QUOTA_OPTIONS -A -wg "$MID" |grep "$QUOTA_PART" | awk 'END { 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 [ -z "$val" ] ; then
|
||||||
|
|
Loading…
Reference in New Issue