
#!/bin/sh
# File	: get_dfm-options.sh
# By	: Maarten de Boer, 141021
# Subject	: Scripts to get the list of DFM-options & put into .CSV

PGM="`basename $0|cut -d\. -f1`"
VER="0.1"
TMP="/tmp/${PGM}.$$"
LOG="${HOME}/log/${PGM}.log"
MAILTO="maarten.deboer@atos.net"
HOSTNAME="`hostname|cut -d\. -f1`"
DATI="`date +%Y-%m-%d_%H-%M`"
CSV="${HOME}/etc/FSOD_dfm-options_${DATI}.csv"

touch ${TMP}
echo "`date` ${PGM} v${VER} started"|tee -a ${LOG}

/usr/bin/dfm options list|awk -v HOSTNAME=$HOSTNAME '{print HOSTNAME";"$1";"$2";"$3";"}' > ${CSV}
date | mailx -a ${CSV} -s "dfm options list" ${MAILTO}
echo "Mailed the 'dfm options list' (${CSV}) to ${MAILTO}"|tee -a ${LOG}

rm ${TMP}
exit 0

