43 lines
604 B
Bash
43 lines
604 B
Bash
|
## disk_free jabber bot ##
|
||
|
##########################
|
||
|
|
||
|
## configuration section
|
||
|
configfilepath=$(pwd)
|
||
|
if [ -f $configfilepath/df.conf ]; then
|
||
|
source $configfilepath/df.conf
|
||
|
else
|
||
|
echo "Exiting because there is no config file."
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
## default config
|
||
|
if [ -z $logfile ]; then
|
||
|
# using default path
|
||
|
logfile="/var/log/mobots/df.log"
|
||
|
|
||
|
else
|
||
|
echo "using logfile defined in the config file"
|
||
|
fi
|
||
|
|
||
|
## ckeck environment
|
||
|
|
||
|
## get local disks
|
||
|
|
||
|
|
||
|
## check disks
|
||
|
data=$(df -Pl | grep $disk0)
|
||
|
echo $data
|
||
|
|
||
|
|
||
|
## actions (jabber, logfile)
|
||
|
|
||
|
|
||
|
## testing output
|
||
|
echo $logfile
|
||
|
|
||
|
## exiting
|
||
|
exit 0
|