Skip to content

Instantly share code, notes, and snippets.

@valumar
Created March 17, 2016 12:21
Show Gist options
  • Select an option

  • Save valumar/f930ad0d3eacf20af081 to your computer and use it in GitHub Desktop.

Select an option

Save valumar/f930ad0d3eacf20af081 to your computer and use it in GitHub Desktop.

Revisions

  1. @bezumkin bezumkin revised this gist Mar 28, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion update.sh
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@ cd /var/www/$USERNAME/www/
    echo "Getting file from modx.com..."
    sudo -u $USERNAME wget -O modx.zip http://modx.com/download/latest/
    echo "Unzipping file..."
    sudo -u $USERNAME unzip "./modx.zip" -d ./
    sudo -u $USERNAME unzip "./modx.zip" -d ./ > /dev/null

    ZDIR=`ls -F | grep "modx-" | head -1`
    if [ "${ZDIR}" = "/" ]; then
  2. @bezumkin bezumkin revised this gist Mar 24, 2012. 1 changed file with 2 additions and 7 deletions.
    9 changes: 2 additions & 7 deletions update.sh
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,13 @@
    #!/bin/bash

    # include required files
    source modx.cfg

    ##############

    echo "Enter username"
    read USERNAME

    ##############

    echo "Updating MODx"

    cd /home/$USERNAME/htdocs/
    cd /var/www/$USERNAME/www/

    echo "Getting file from modx.com..."
    sudo -u $USERNAME wget -O modx.zip http://modx.com/download/latest/
    @@ -36,7 +31,7 @@ if [ -d "${ZDIR}" ]; then

    cd "setup"
    echo "Running setup..."
    sudo -u $USERNAME php ./index.php --installmode=upgrade --config=/home/$USERNAME/config.xml
    sudo -u $USERNAME php ./index.php --installmode=upgrade --config=/var/www/$USERNAME/config.xml

    echo "Done!"
    else
  3. @NoPizzaNoGlory NoPizzaNoGlory created this gist Feb 8, 2012.
    47 changes: 47 additions & 0 deletions update.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,47 @@
    #!/bin/bash

    # include required files
    source modx.cfg

    ##############

    echo "Enter username"
    read USERNAME

    ##############

    echo "Updating MODx"

    cd /home/$USERNAME/htdocs/

    echo "Getting file from modx.com..."
    sudo -u $USERNAME wget -O modx.zip http://modx.com/download/latest/
    echo "Unzipping file..."
    sudo -u $USERNAME unzip "./modx.zip" -d ./

    ZDIR=`ls -F | grep "modx-" | head -1`
    if [ "${ZDIR}" = "/" ]; then
    echo "Failed to find directory..."; exit
    fi

    if [ -d "${ZDIR}" ]; then
    cd ${ZDIR}
    echo "Moving out of temp dir..."
    sudo -u $USERNAME cp -r ./* ../
    cd ../
    rm -r "./${ZDIR}"

    echo "Removing zip file..."
    rm "./modx.zip"

    cd "setup"
    echo "Running setup..."
    sudo -u $USERNAME php ./index.php --installmode=upgrade --config=/home/$USERNAME/config.xml

    echo "Done!"
    else
    echo "Failed to find directory: ${ZDIR}"
    exit
    fi

    echo "Done"