blob: 528bd5b4a4a39c0db5371ae4b36d66f386c6305a [file] [log] [blame]
Matthew Treinish90ac9142014-03-17 14:58:37 +00001#!/usr/bin/env bash
2
3PROJECT_NAME=${PROJECT_NAME:-tempest}
4CFGFILE_NAME=${PROJECT_NAME}.conf.sample
5
6if [ -e etc/${PROJECT_NAME}/${CFGFILE_NAME} ]; then
7 CFGFILE=etc/${PROJECT_NAME}/${CFGFILE_NAME}
8elif [ -e etc/${CFGFILE_NAME} ]; then
9 CFGFILE=etc/${CFGFILE_NAME}
10else
11 echo "${0##*/}: can not find config file"
12 exit 1
13fi
14
15TEMPDIR=`mktemp -d /tmp/${PROJECT_NAME}.XXXXXX`
16trap "rm -rf $TEMPDIR" EXIT
17
18tools/config/generate_sample.sh -b ./ -p ${PROJECT_NAME} -o ${TEMPDIR}
19
20if ! diff -u ${TEMPDIR}/${CFGFILE_NAME} ${CFGFILE}
Matthew Treinish3d468112013-10-24 21:49:14 +000021then
Matthew Treinish90ac9142014-03-17 14:58:37 +000022 echo "${0##*/}: ${PROJECT_NAME}.conf.sample is not up to date."
23 echo "${0##*/}: Please run ${0%%${0##*/}}generate_sample.sh."
24 exit 1
Matthew Treinish3d468112013-10-24 21:49:14 +000025fi