this is the script I'm using
quick and dirty but works
it gets the pools values and reports them to the windows clients
Code:
#!/bin/bash
#origin from: http://stanislavs.org/reporting-correct-space-usage-for-samba-shared-zfs-volumes
SUC=0
CURPATH=`pwd`
POOL1=/mnt/Data
POOL2=/mnt/Media
echo $CURPATH | grep $POOL1 >> /dev/null
if [[ $? == $SUC ]] ; then
CURPATH=$POOL1
fi
echo $CURPATH | grep $POOL2 >> /dev/null
if [[ $? == $SUC ]] ; then
CURPATH=$POOL2
fi
USED=$((`zfs get -o value -Hp used $CURPATH` / 1024)) > /dev/null
AVAIL=$((`zfs get -o value -Hp available $CURPATH` / 1024)) > /dev/null
TOTAL=$(($USED+$AVAIL)) > /dev/null
echo $TOTAL $AVAIL
it is stored as '/path/to/script/dfree'
and I've added this line to the smb aux parameters
Code:
dfree command = /path/to/script/dfree