ttrss/utils/regen_config_checks.sh

18 lines
555 B
Bash
Raw Normal View History

#!/bin/sh
2011-12-12 06:29:06 +00:00
DESTINATION="include/sanity_config.php"
echo "<?php # This file has been generated at: " `date` > $DESTINATION
echo -n "define('GENERATED_CONFIG_CHECK', " >> $DESTINATION
grep CONFIG_VERSION config.php-dist | awk -F ' |\)' '{ print $2 }' | xargs echo -n >> $DESTINATION
echo ");" >> $DESTINATION
2021-02-22 11:41:09 +00:00
echo -n "function get_required_defines() { return [ " >> $DESTINATION
grep define\( config.php-dist | awk -F\' '{ print "*" $2 "*," }' | grep -v DB_PORT | xargs echo -n | sed -e s/,$// -e s/*/\'/g >> $DESTINATION
2021-02-22 11:41:09 +00:00
echo "]; }" >> $DESTINATION