Skip to content

Instantly share code, notes, and snippets.

@byronrode
Created September 20, 2011 12:31
Show Gist options
  • Save byronrode/1228974 to your computer and use it in GitHub Desktop.
Save byronrode/1228974 to your computer and use it in GitHub Desktop.
Update TimThumb across your Server
#!/bin/bash
# Fix TimThumb
# The following will replace any versions of timthumb.php or thumb.php across your server.
# Change the folder to match your server's setup.
# If you have made any modifications, or have any additional allowed hosts in your current
# TimThumb file they will be updated, so make sure you have those changes backed up.
wget -q -O /tmp/new_timthumb.php http://timthumb.googlecode.com/svn/trunk/timthumb.php
find /var/www/vhosts/ -name "thumb.php" -exec bash -c "echo Replacing file {} && cp /tmp/new_timthumb.php {}" \;
find /var/www/vhosts/ -name "timthumb.php" -exec bash -c "echo Replacing file {} && cp /tmp/new_timthumb.php {}" \;
echo "All files updated."
rm /tmp/new_timthumb.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment