Skip to content

Instantly share code, notes, and snippets.

@aamnah
Last active April 6, 2020 15:06
Show Gist options
  • Select an option

  • Save aamnah/93cb63fc15e708649084 to your computer and use it in GitHub Desktop.

Select an option

Save aamnah/93cb63fc15e708649084 to your computer and use it in GitHub Desktop.

Revisions

  1. aamnah revised this gist Jul 24, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install-opencart.sh
    Original file line number Diff line number Diff line change
    @@ -28,7 +28,7 @@ Color_Off='\033[0m' # Text Reset
    }

    # Ask for version
    echo -e "${Cyan} What version should i install? (for example: ${BCyan}1.5.6.4${Cyan} or ${BCyan}2.0.1.1${Cyan})${Color_Off}"
    echo -e "${Cyan} What version should i install? (for example: ${BCyan}1.5.6.4${Cyan} or ${BCyan}3.0.2.0${Cyan})${Color_Off}"
    read VERSION

    checkVersion
  2. aamnah revised this gist Jul 24, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install-opencart.sh
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,7 @@ Color_Off='\033[0m' # Text Reset

    checkVersion() {
    # check if version provided is a valid OpenCart release
    version_list=("2.0.1.1" "2.0.1.0" "2.0.0.0" "1.5.6.4" "1.5.6.3" "1.5.6.2" "1.5.6.1" "1.5.6" "1.5.5.1" "1.5.4.1" "1.5.4")
    version_list=("3.0.2.0" "3.0.1.2" "3.0.1.1" "3.0.0.0" "2.3.0.2" "2.3.0.1" "2.3.0.0" "2.2.0.0" "2.1.0.2" "2.1.0.1" "2.0.3.1" "2.0.2.0" "2.0.1.1" "2.0.1.0" "2.0.0.0" "1.5.6.4" "1.5.6.3" "1.5.6.2" "1.5.6.1" "1.5.6" "1.5.5.1" "1.5.4.1" "1.5.4")

    match=0
    for v in "${version_list[@]}"
  3. aamnah revised this gist Feb 26, 2015. 1 changed file with 21 additions and 5 deletions.
    26 changes: 21 additions & 5 deletions install-opencart.sh
    Original file line number Diff line number Diff line change
    @@ -13,17 +13,32 @@ Red='\033[0;31m' # Red
    BCyan='\033[1;36m' # Bold Cyan
    Color_Off='\033[0m' # Text Reset

    version_list=[2.0.1.1, 2.0.1.0, 2.0.0.0, 1.5.6.4, 1.5.6.3, 1.5.6.2, 1.5.6.1, 1.5.6, 1.5.5.1, 1.5.4.1, 1.5.4]
    checkVersion() {
    # check if version provided is a valid OpenCart release
    version_list=("2.0.1.1" "2.0.1.0" "2.0.0.0" "1.5.6.4" "1.5.6.3" "1.5.6.2" "1.5.6.1" "1.5.6" "1.5.5.1" "1.5.4.1" "1.5.4")

    match=0
    for v in "${version_list[@]}"
    do
    if [[ $v = "$VERSION" ]]; then
    match=1
    break
    fi
    done
    }

    # Ask for version
    echo -e "${Cyan} What version should i install? (for example: ${BCyan}1.5.6.4${Cyan} or ${BCyan}2.0.1.1${Cyan})${Color_Off}"
    read VERSION

    # check if version provided is a valid release
    if ! [ $VERSION in version_list ]; then
    checkVersion

    if [[ $match = 0 ]]; then
    echo -e "${Red} Not a valid OpenCart version. Exiting.. ${Color_Off}"
    return 1
    return 0
    fi

    else
    if [[ $match = 1 ]]; then
    # Download files for that version from Github
    echo -e "${Cyan} Downloading files.. ${Color_Off}"
    wget -O opencart-$VERSION.zip https://codeload.github.com/opencart/opencart/zip/$VERSION
    @@ -40,4 +55,5 @@ Color_Off='\033[0m' # Text Reset

    echo -e "${Green} Opencart was successfully copied. Please run the install script to finish installation. \n
    http://yourdomain.com/install \n ${Color_Off}"
    return 1
    fi
  4. aamnah revised this gist Feb 26, 2015. 1 changed file with 25 additions and 16 deletions.
    41 changes: 25 additions & 16 deletions install-opencart.sh
    Original file line number Diff line number Diff line change
    @@ -9,26 +9,35 @@
    # COLORS
    Cyan='\033[0;36m' # Cyan
    Green='\033[0;32m' # Green
    Red='\033[0;31m' # Red
    BCyan='\033[1;36m' # Bold Cyan
    Color_Off='\033[0m' # Text Reset

    # Ask for version
    echo -e "${Cyan} What version should i install? (for example: ${BCyan}1.5.6.4${Cyan} or ${BCyan}2.0.1.1${Cyan})${Color_Off}"
    read VERSION
    version_list=[2.0.1.1, 2.0.1.0, 2.0.0.0, 1.5.6.4, 1.5.6.3, 1.5.6.2, 1.5.6.1, 1.5.6, 1.5.5.1, 1.5.4.1, 1.5.4]
    # Ask for version
    echo -e "${Cyan} What version should i install? (for example: ${BCyan}1.5.6.4${Cyan} or ${BCyan}2.0.1.1${Cyan})${Color_Off}"
    read VERSION

    # Download files for that version from Github
    echo -e "${Cyan} Downloading files.. ${Color_Off}"
    wget -O opencart-$VERSION.zip https://codeload.github.com/opencart/opencart/zip/$VERSION
    # check if version provided is a valid release
    if ! [ $VERSION in version_list ]; then
    echo -e "${Red} Not a valid OpenCart version. Exiting.. ${Color_Off}"
    return 1

    echo -e "${Cyan} Extracting.. ${Color_Off}"
    tar zxvf opencart-$VERSION.zip
    else
    # Download files for that version from Github
    echo -e "${Cyan} Downloading files.. ${Color_Off}"
    wget -O opencart-$VERSION.zip https://codeload.github.com/opencart/opencart/zip/$VERSION

    echo -e "${Cyan} Cleaning up.. ${Color_Off}"
    mv opencart-$VERSION/* .
    rm -rf opencart-$VERSION.zip opencart-$VERSION
    mv upload/* .
    mv upload/.htaccess.txt ./.htaccess
    rmdir upload
    echo -e "${Cyan} Extracting.. ${Color_Off}"
    tar zxvf opencart-$VERSION.zip

    echo -e "${Green} Opencart was successfully copied. Please run the install script to finish installation. \n
    http://yourdomain.com/install \n ${Color_Off}"
    echo -e "${Cyan} Cleaning up.. ${Color_Off}"
    mv opencart-$VERSION/* .
    rm -rf opencart-$VERSION.zip opencart-$VERSION
    mv upload/* .
    mv upload/.htaccess.txt ./.htaccess
    rmdir upload

    echo -e "${Green} Opencart was successfully copied. Please run the install script to finish installation. \n
    http://yourdomain.com/install \n ${Color_Off}"
    fi
  5. aamnah revised this gist Feb 26, 2015. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions install-opencart.sh
    Original file line number Diff line number Diff line change
    @@ -31,5 +31,4 @@ mv upload/.htaccess.txt ./.htaccess
    rmdir upload

    echo -e "${Green} Opencart was successfully copied. Please run the install script to finish installation. \n
    http://yourdomain.com/install \n ${Color_Off}"
    }
    http://yourdomain.com/install \n ${Color_Off}"
  6. aamnah revised this gist Feb 26, 2015. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions install-opencart.sh
    Original file line number Diff line number Diff line change
    @@ -17,13 +17,13 @@ echo -e "${Cyan} What version should i install? (for example: ${BCyan}1.5.6.4${C
    read VERSION

    # Download files for that version from Github
    echo -e "$ {Cyan}Downloading files.. ${Color_Off}"
    echo -e "${Cyan} Downloading files.. ${Color_Off}"
    wget -O opencart-$VERSION.zip https://codeload.github.com/opencart/opencart/zip/$VERSION

    echo -e "$ {Cyan}Extracting.. ${Color_Off}"
    echo -e "${Cyan} Extracting.. ${Color_Off}"
    tar zxvf opencart-$VERSION.zip

    echo -e "$ {Cyan}Cleaning up.. ${Color_Off}"
    echo -e "${Cyan} Cleaning up.. ${Color_Off}"
    mv opencart-$VERSION/* .
    rm -rf opencart-$VERSION.zip opencart-$VERSION
    mv upload/* .
    @@ -32,3 +32,4 @@ rmdir upload

    echo -e "${Green} Opencart was successfully copied. Please run the install script to finish installation. \n
    http://yourdomain.com/install \n ${Color_Off}"
    }
  7. aamnah revised this gist Feb 17, 2015. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion install-opencart.sh
    Original file line number Diff line number Diff line change
    @@ -6,8 +6,14 @@
    # Usage: You can use 'curl' to run this script directly from Github.
    # curl -L https://gist.github.com/aamnah/93cb63fc15e708649084/raw | bash

    # COLORS
    Cyan='\033[0;36m' # Cyan
    Green='\033[0;32m' # Green
    BCyan='\033[1;36m' # Bold Cyan
    Color_Off='\033[0m' # Text Reset

    # Ask for version
    echo -e "${Cyan} What version should i install? (for example: 1.5.6.4 or 2.0.1.1)${Color_Off}"
    echo -e "${Cyan} What version should i install? (for example: ${BCyan}1.5.6.4${Cyan} or ${BCyan}2.0.1.1${Cyan})${Color_Off}"
    read VERSION

    # Download files for that version from Github
  8. aamnah revised this gist Feb 17, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install-opencart.sh
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@
    # curl -L https://gist.github.com/aamnah/93cb63fc15e708649084/raw | bash

    # Ask for version
    echo -e "${Cyan} What version should i install? (for example '1.5.6.4' or '2.0.1.1')${Color_Off}"
    echo -e "${Cyan} What version should i install? (for example: 1.5.6.4 or 2.0.1.1)${Color_Off}"
    read VERSION

    # Download files for that version from Github
  9. aamnah revised this gist Feb 17, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install-opencart.sh
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@
    # curl -L https://gist.github.com/aamnah/93cb63fc15e708649084/raw | bash

    # Ask for version
    echo -e "${Cyan} What version should i install? ('1.5.6.4' or '2.0.1.1')${Color_Off}"
    echo -e "${Cyan} What version should i install? (for example '1.5.6.4' or '2.0.1.1')${Color_Off}"
    read VERSION

    # Download files for that version from Github
  10. aamnah revised this gist Feb 17, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install-opencart.sh
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@
    # Email: [email protected]
    # Description: Bash script to install Opencart
    # Usage: You can use 'curl' to run this script directly from Github.
    # curl -L http://gist.url | bash
    # curl -L https://gist.githubusercontent.com/aamnah/93cb63fc15e708649084/raw | bash

    # Ask for version
    echo -e "${Cyan} What version should i install? ('1.5.6.4' or '2.0.1.1')${Color_Off}"
  11. aamnah created this gist Feb 17, 2015.
    28 changes: 28 additions & 0 deletions install-opencart.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    #!/bin/bash
    # Author: Aamnah Akram
    # URL: http://aamnah.com
    # Email: [email protected]
    # Description: Bash script to install Opencart
    # Usage: You can use 'curl' to run this script directly from Github.
    # curl -L http://gist.url | bash

    # Ask for version
    echo -e "${Cyan} What version should i install? ('1.5.6.4' or '2.0.1.1')${Color_Off}"
    read VERSION

    # Download files for that version from Github
    echo -e "$ {Cyan}Downloading files.. ${Color_Off}"
    wget -O opencart-$VERSION.zip https://codeload.github.com/opencart/opencart/zip/$VERSION

    echo -e "$ {Cyan}Extracting.. ${Color_Off}"
    tar zxvf opencart-$VERSION.zip

    echo -e "$ {Cyan}Cleaning up.. ${Color_Off}"
    mv opencart-$VERSION/* .
    rm -rf opencart-$VERSION.zip opencart-$VERSION
    mv upload/* .
    mv upload/.htaccess.txt ./.htaccess
    rmdir upload

    echo -e "${Green} Opencart was successfully copied. Please run the install script to finish installation. \n
    http://yourdomain.com/install \n ${Color_Off}"