Guest User

Untitled

a guest
Jun 20th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. set -e
  4.  
  5. if [ -z "$1" ]; then
  6. echo "Usage: $0 <wp-rocket-config.php-path>"
  7. exit 1
  8. fi
  9.  
  10. WP_ROCKET_CONFIG_FILE=$1
  11.  
  12. if [ -z "$WP_ROCKET_COOKIEHASH" ] || [ -z "$WP_ROCKET_SECRET_CACHE_KEY" ]; then
  13. echo "All variables have to be defined."
  14. exit 1
  15. fi
  16.  
  17. cat > $WP_ROCKET_CONFIG_FILE <<'EOM'
  18. <?php
  19. defined( 'ABSPATH' ) or die( 'Cheatin\' uh?' );
  20.  
  21. $rocket_cookie_hash = 'a9b9f04336ce0181a08e774e01113b31';
  22. $rocket_cache_mobile = '1';
  23. $rocket_do_caching_mobile_files = '1';
  24. $rocket_cache_ssl = '1';
  25. $rocket_cache_reject_uri = '(.*)/feed/?|/wp-json/(.*)';
  26. $rocket_cache_reject_cookies = 'wordpress_logged_in_|wp-postpass_|wptouch_switch_toggle|comment_author_|comment_author_email_';
  27. $rocket_cache_reject_ua = 'facebookexternalhit';
  28. $rocket_cache_query_strings = array (
  29. );
  30. $rocket_secret_cache_key = '38bda234b929ea8515198';
  31. $rocket_cache_mandatory_cookies = '';
  32. $rocket_cache_dynamic_cookies = array (
  33. );
  34. EOM
  35.  
  36. # Replace
  37. sed -i $WP_ROCKET_CONFIG_FILE \
  38. -e "s/a9b9f04336ce0181a08e774e01113b31/$(echo $WP_ROCKET_COOKIEHASH)/" \
  39. -e "s/38bda234b929ea8515198/$WP_ROCKET_SECRET_CACHE_KEY/"
Add Comment
Please, Sign In to add comment