File: //usr/syno/share/projectquota.sh
#!/bin/sh
[ -z "$__INCLUDE_PROJECTQUOTA_SH__" ] || return
readonly __INCLUDE_PROJECTQUOTA_SH__=defined
. /usr/syno/share/kernelversion.sh
GetPQMountOpt()
{
local MountDev="$1"
if [ "$(KernelVersionCode "$(KernelVersion)")" -ge "$(KernelVersionCode "4.4")" ] ; then
if /sbin/tune2fs -l ${MountDev} | /bin/grep "^Filesystem features:" | /bin/grep -q -w project ; then
echo "-oprjquota,rootprjquota"
return 0
fi
fi
echo
}
PQMounted()
{
local MountPoint="$1"
if [ -z "${MountPoint}" ]; then
return 1
fi
local MountLine
MountLine=$(grep " $MountPoint " /proc/mounts)
if [ "${MountPoint}" != "$(echo "$MountLine" | cut -d ' ' -f 2 )" ]; then
return 1
fi
echo "$MountLine" | cut -d ' ' -f 4 | grep -qw prjquota
}