Skip to content

Instantly share code, notes, and snippets.

@lilactown
Last active February 4, 2016 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lilactown/1d7341242e63401a117e to your computer and use it in GitHub Desktop.
Save lilactown/1d7341242e63401a117e to your computer and use it in GitHub Desktop.
Putting this here so I'm not downloading and running an uncontrolled script as root all the time.
#!/bin/bash
# Written by Andy Boutte and David Balderston of howtoinstallghost.com, ghostforbeginners.com and allaboutghost.com
# updateghost.sh will update your current ghost install to the latest version without you losing any content
if [ -f config.js ]
then
echo `whoami`
# Make temporary directory and download latest Ghost.
mkdir temp
cd temp
curl -L -O https://ghost.org/zip/ghost-latest.zip
unzip *.zip
cd ..
# Make database backups.
for file in content/data/*.db;
do cp "$file" "${file}-backup-`date +%Y%m%d`";
done
# Copy the new files over.
yes | cp temp/*.md temp/*.js temp/*.json .
rm -R core
yes | cp -R temp/core .
yes | cp -R temp/content/themes/casper content/themes
npm install --production
# Delete temp folder.
rm -R temp
echo "You can now start Ghost with npm, forever or whatever else you use."
else
echo "Please cd to your Ghost directory."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment