deb-heat/tools/config/check_uptodate.sh
Thomas Herve 7f7817c157 Sync with oslo incubator
Sync with oslo incubator at 45890dae35cd14a25175cdce7c12a5f9acbd712f

Change-Id: I44ecc69f1d952061be7cb2f41678b879ded93eae
2014-06-17 11:22:37 +02:00

30 lines
718 B
Bash
Executable File

#!/usr/bin/env bash
PROJECT_NAME=${PROJECT_NAME:-heat}
CFGFILE_NAME=${PROJECT_NAME}.conf.sample
if [ -e etc/${PROJECT_NAME}/${CFGFILE_NAME} ]; then
CFGFILE=etc/${PROJECT_NAME}/${CFGFILE_NAME}
elif [ -e etc/${CFGFILE_NAME} ]; then
CFGFILE=etc/${CFGFILE_NAME}
else
echo "${0##*/}: can not find config file"
exit 1
fi
TEMPDIR=`mktemp -d /tmp/${PROJECT_NAME}.XXXXXX`
trap "rm -rf $TEMPDIR" EXIT
tools/config/generate_sample.sh -b ./ -p ${PROJECT_NAME} -o ${TEMPDIR}
if [ $? != 0 ]
then
exit 1
fi
if ! diff -u ${TEMPDIR}/${CFGFILE_NAME} ${CFGFILE}
then
echo "${0##*/}: ${PROJECT_NAME}.conf.sample is not up to date."
echo "${0##*/}: Please run ${0%%${0##*/}}generate_sample.sh."
exit 1
fi