I've created my own quota commands to set quota's on a sun 7110 storage. It seems this scripts isn't called with the arguments which are documented? Only the username is passed as argument to the script. The soft and hard quota are missing. I created to "echo $* >> /var/log/virtualminscripts.info" to verify only one argument is passed?
Is this a bug in the code, in the documentation, or in my script :)
============!/bin/ksh Command to set a user's quota When external quota commands are being used, the program set in this option will be called when Virtualmin wants to set the quotas for a Unix user. The parameters it is called with are : The Unix username The new soft quota in 1 kB blocks, or 0 for unlimited. The new hard quota in 1 kB blocks, or 0 for unlimited.
echo $* >> /var/log/virtualminscripts.info
echo $1 | grep "@" > /dev/null
if [[ 0 -eq $? ]]; then
echo $1 | sed 's/-/@/'
if [[ -z $2 ]]; then
echo "$2 * 1024" | bc
if [[ -z $3 ]]; then
echo "$3 * 1024" | bc
if [[ $USERNAME = $SHARENAME ]]; then /opt/redknot/scripts/fishworks/set-quota.ksh -P Slow -p home -s $SHARENAME -q $QUOTA -r $RESERVATION else /opt/redknot/scripts/fishworks/set-userquota.ksh -P Slow -p home -s $SHARENAME -u $USERNAME -q $QUOTA fi