regen_config_checks.sh 540 B

1234567891011121314151617
  1. #!/bin/sh
  2. DESTINATION="include/sanity_config.php"
  3. echo "<?php # This file has been generated at: " `date` > $DESTINATION
  4. echo -n "define('GENERATED_CONFIG_CHECK', " >> $DESTINATION
  5. grep CONFIG_VERSION config.php-dist | awk -F ' |)' '{ print $2 }' | xargs echo -n >> $DESTINATION
  6. echo ");" >> $DESTINATION
  7. echo -n "\$required_defines = array( " >> $DESTINATION
  8. grep define\( config.php-dist | awk -F\' '{ print "*" $2 "*," }' | grep -v DB_PORT | xargs echo -n | sed -e s/,$// -e s/*/\'/g >> $DESTINATION
  9. echo "); ?>" >> $DESTINATION