Created
February 15, 2020 04:59
-
-
Save SofianeHamlaoui/0853b206d296c9c4a1b4255031abcc97 to your computer and use it in GitHub Desktop.
checkPrerequisites
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
| function checkPrerequisites(){ | |
| if ! uname -a | grep -i "x86_64" | grep -qi "Linux"; then | |
| echo >&2 "Sorry! This installer is only compatible with Linux on x86_64. Terminating." | |
| exit 10 | |
| fi | |
| if ! grep -q '\<avx[^ ]*\>' /proc/cpuinfo; then | |
| echo >&2 "Sorry! Kite only runs on processor architectures with AVX support. Exiting now." | |
| exit 12 | |
| fi | |
| if [ -f /etc/centos-release ] && [ $(cat /etc/centos-release | tr -dc '0-9.' | cut -d \. -f1) -lt 8 ]; then | |
| echo >&2 "Sorry! This installer is not compatible with CentOS 7 and earlier due to incomplete systemd support." | |
| echo >&2 "See https://bugzilla.redhat.com/show_bug.cgi?id=1173278 for details. Exiting now." | |
| exit 10 | |
| fi | |
| if [ -f /etc/redhat-release ] && [ $(cat /etc/redhat-release | tr -dc '0-9.' | cut -d \. -f1) -lt 8 ]; then | |
| echo >&2 "Sorry! This installer is not compatible with RHEL 7 and earlier due to incomplete systemd support." | |
| echo >&2 "See https://bugzilla.redhat.com/show_bug.cgi?id=1173278 for details. Exiting now." | |
| exit 10 | |
| fi | |
| if [ "$(id -u)" = "0" ]; then | |
| echo >&2 "Sorry! This installer should not be run as root. Terminating." | |
| exit 20 | |
| fi | |
| if ! command -v systemctl &> /dev/null; then | |
| echo >&2 "Sorry! We use systemd to setup services as part of the Kite install, and we couldn't find it on" | |
| echo >&2 "your system. We currently don't support distributions that do not use systemd. Exiting now." | |
| exit 30 | |
| fi | |
| if uname -r | grep -qi "Microsoft"; then | |
| echo >&2 "Sorry! This installer is not compatible with Windows Subsystem for Linux. Exiting now." | |
| exit 40 | |
| fi | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment