-STATINGDIR="/etc/apache2/sites-staging"
+STAGINGDIR="/etc/apache2/sites-staging"
DESTINATION="/etc/apache2/sites-available"
usage() {
exit 1
fi
-if ! [ -f "$STATINGDIR/$site" ]; then
- echo "$STATINGDIR/$site does not exist or is not a file" >&2
+if [ -f "$STAGINGDIR/$site.conf" -a ! -f "$STAGINGDIR/$site" ] ; then
+ site="$site.conf"
+fi
+
+if ! [ -f "$STAGINGDIR/$site" ]; then
+ echo "$STAGINGDIR/$site does not exist or is not a file" >&2
exit 1
fi
exit 1
fi
-if diff "$STATINGDIR/$site" "$DESTINATION/$site" > /dev/null; then
+if diff "$STAGINGDIR/$site" "$DESTINATION/$site" > /dev/null; then
echo "No differences, not doing anything." >&2
exit 1
fi
exit 1
fi
-cp -f "$STATINGDIR/$site" "$DESTINATION/$site"
+cp -f "$STAGINGDIR/$site" "$DESTINATION/$site"
if grep -i include "$DESTINATION/$site" > /dev/null; then
echo "New site may have include statements - rejecting." >&2