Advertisement
cnxsoft

Quick Cache No <Body> Fix

Jan 16th, 2014
287
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. #Edit the path below for your installation
  3. WP_PATH=
  4. if [ -z $WP_PATH ]; then
  5.         echo "WP_PATH not set, please edit the script to define WP_PATH"
  6.         exit 0
  7. fi
  8. nobody_files=`grep -L body $WP_PATH/wp-content/cache/qc-c-*`
  9. num_files=$((`echo "$nobody_files" | wc -l` - 1))
  10.  
  11. if [ $num_files == 0 ]
  12. then
  13.         echo "No cached file without <body> tag could be found"
  14. else
  15.         echo "Deleting $num_files cache files without <body> tag"
  16.         rm $nobody_files
  17. fi
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement