Last active
August 19, 2019 06:43
-
-
Save growtopiajaw/61ace20a5035aafa0d1faab956634d9a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [ -r /etc/os-release ]; then | |
| echo " detecting OS type : " | |
| . /etc/os-release | |
| if [ $ID == "debian" ]; then | |
| echo "detected OS: $ID - $VERSION_ID" | |
| echo " now enable the LiteSpeed Debian Repo " | |
| if [ $VERSION_ID == "8" ]; then | |
| echo "deb http://rpms.litespeedtech.com/debian/ jessie main" > /etc/apt/sources.list.d/lst_debian_repo.list | |
| elif [ $VERSION_ID == "7" ]; then | |
| echo "deb http://rpms.litespeedtech.com/debian/ wheezy main" > /etc/apt/sources.list.d/lst_debian_repo.list | |
| fi | |
| elif [ $ID == "ubuntu" ]; then | |
| echo "detected OS: $ID - $VERSION_ID" | |
| echo " now enable the LiteSpeed Debian Repo " | |
| if [ `echo "$VERSION_ID" | cut -b-2 ` == "14" ]; then | |
| echo "deb http://rpms.litespeedtech.com/debian/ trusty main" > /etc/apt/sources.list.d/lst_debian_repo.list | |
| elif [ `echo "$VERSION_ID" | cut -b-2 ` == "12" ]; then | |
| echo "deb http://rpms.litespeedtech.com/debian/ precise main" > /etc/apt/sources.list.d/lst_debian_repo.list | |
| elif [ `echo "$VERSION_ID" | cut -b-2 ` == "16" ]; then | |
| echo "deb http://rpms.litespeedtech.com/debian/ xenial main" > /etc/apt/sources.list.d/lst_debian_repo.list | |
| fi | |
| else | |
| echo " This distribution is not currently supported by LST repo " | |
| echo " If you really have the needs please contact LiteSpeed for support " | |
| fi | |
| else | |
| echo " The /etc/os-release file doesn't exist " | |
| echo " This script couldn't determine which distribution of the repo should be enabled " | |
| echo " Please consult LiteSpeed Customer Support for further assistance " | |
| fi | |
| echo " register LiteSpeed GPG key " | |
| wget -O /etc/apt/trusted.gpg.d/lst_debian_repo.gpg http://rpms.litespeedtech.com/debian/lst_debian_repo.gpg | |
| echo " update the repo " | |
| apt-get update | |
| echo " All done, congratulations and enjoy ! " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment