exit 1
fi
-# Setup
-cd ${WORKDIR}
-
+# Update repository
echo 'Updating repository'
git pull
+# Ensure there are no uncommitted changes
+cd ${APACHEDIR}
+echo 'Checking for uncommited changes'
+git diff --name-only --exit-code > /dev/null
+
+if [ $? -ne 0 ]; then
+ echo "There are uncommited changes in ${APACHEDIR}." >&2
+ echo "Sincerely yours," >&2
+ echo "$(hostname)" >&2
+ exit 1
+fi
+
# Generate updated configuration
+cd ${WORKDIR}
echo 'Generating new configuration'
./generate-expire-config > ${CONFIGFILE}