Skip to content

Instantly share code, notes, and snippets.

@shaunoconnor
Last active August 29, 2015 14:02
Show Gist options
  • Save shaunoconnor/98c47ce28f6887fc91e5 to your computer and use it in GitHub Desktop.
Save shaunoconnor/98c47ce28f6887fc91e5 to your computer and use it in GitHub Desktop.

Revisions

  1. shaunoconnor revised this gist Jun 17, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions updateghost_ami
    Original file line number Diff line number Diff line change
    @@ -35,5 +35,5 @@ rm -R temp
    chown -R ghost:ghost /var/www/ghost/

    #Start Ghost Again
    pm2 start index.js --name ghost
    echo "###### Ghost Started
    forever start index.js --name ghost
    echo "###### Ghost Started ######"
  2. shaunoconnor created this gist Jun 17, 2014.
    39 changes: 39 additions & 0 deletions updateghost_ami
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    #!/bin/bash
    # Based upon - Written by Andy Boutte and David Balderston of howtoinstallghost.com and allaboutghost.com
    # updateghost_ami.sh will update your current Amazon ami ghost install to the latest version without you losing any content

    if [[ `whoami` != root ]]; then
    echo "This script must be run as root"
    exit 1
    fi

    #Stop Ghost
    pm2 stop all

    #Make Tempory Directory and Download Lates Ghost
    cd /var/www/ghost
    mkdir temp
    cd temp
    wget https://github.com/TryGhost/Ghost/releases/download/0.4.1/Ghost-0.4.1.zip
    unzip *.zip
    cd ..

    #Make Backup DB
    cp content/data/ghost.db content/data/ghost_backup.db
    echo "###### Data Backed Up ######"

    #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
    echo "###### NPM Installed ######"

    #Delete temp folder
    rm -R temp
    chown -R ghost:ghost /var/www/ghost/

    #Start Ghost Again
    pm2 start index.js --name ghost
    echo "###### Ghost Started