piwebcam / PiWebcam

Turn a Raspberry Pi into a fully-featured and dummy-proof webcam
https://piwebcam.github.io
52 stars 13 forks source link

Data Filesystem clean up not working #2

Closed user2684 closed 4 years ago

user2684 commented 4 years ago

filesystem_full always returns false! Fix:

function filesystem_full {
        if [[ -n "$1" && -n "$2" ]]; then
                local PERCENTAGE_USED=`df |grep "${1}$"|awk '{print $5}'|sed 's/%//'`
                if [[ -n $PERCENTAGE_USED && $PERCENTAGE_USED -ge $2 ]]; then 
                        true
                else
                        false
                fi
        else
                false
        fi
}