#! /bin/sh
################################################################################
# PROJECT:
#   LANE MACHINE USER INTERFACE
#
# FILE NAME:
#  check_available_device_space
#
# PURPOSE:
#  This script returns the amount of space available on the specified device.
#
# NOTES:
#  Input value is the device to check. example: /dev/hda1
#
# COPYRIGHT NOTICE:
#  Copyright 2004 All rights reserved
#  Brunswick Corp.
#  Proprietary Information
#
# REVISION HISTORY:
#     $Id: get_avail_device_space,v 1.2 2004/10/22 15:29:02 mmead Exp $
################################################################################

# Make sure that df does not return an error
/bin/df $1 > /dev/null 2> /dev/null
if [ "$?" != "0" ]
    then
    exit -1
fi

# valid device - get data from result
echo `/bin/df | grep $1 | sed s#.\*$1" "\*[0-9]\*" "\*[0-9]\*" "\*## | sed s#" ".\*##`
