diff --git a/README.md b/README.md index 45f98de..16fa2d2 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ This will install Git on your machine! |Nginx |Yes|Yes|Yes |Yes|Yes|No |https://installer.to/nginx | |Fabric |No |No |No |No |No |Yes |https://installer.to/hlf | |Docker |Yes|Yes|No |No |No |No |https://installer.to/docker | +|eksctl |No |No |No |No |No |Yes |https://installer.to/eksctl | |cTop |No |No |No |No |No |Yes |https://installer.to/ctop | |Hello |Yes|Yes|Yes |Yes|Yes|Yes |https://installer.to/hello | |Python 3|Yes|Yes|Yes |Yes|Yes|No |https://installer.to/python3| diff --git a/installers.toml b/installers.toml index e20618e..2ea795a 100644 --- a/installers.toml +++ b/installers.toml @@ -38,6 +38,11 @@ installers = "apt,yum" name = "Docker" description = "Docker" +[eksctl] +installers = "curl" +name = "eksctl" +description = "A simple CLI tool for creating clusters on EKS" + [ctop] installers = "curl" name = "cTop" diff --git a/installers/eksctl/installer.min.sh b/installers/eksctl/installer.min.sh new file mode 100644 index 0000000..5bc4b49 --- /dev/null +++ b/installers/eksctl/installer.min.sh @@ -0,0 +1,2 @@ +#!/bin/sh +;CURL_CMD=$(which curl);YUM_CMD=$(which yum);DNF_CMD=$(which dnf);APT_GET_CMD=$(which apt-get);PACMAN_CMD=$(which pacman);APK_CMD=$(which apk);GIT_CMD=$(which git);SUDO_CMD=$(which sudo);;USER="$(id -un 2>/dev/null || true)";SUDO='';if [ "$USER" != 'root' ]; then;if [ ! -z $SUDO_CMD ]; then;SUDO='sudo';else cat >&2 <<-'EOF';Error: this installer needs the ability to run commands as root.;We are unable to find "sudo". Make sure its available to make this happen;EOF;exit 1;fi;fi;;RESET='';RED='';GREEN='';YELLOW='';log () { echo "[`date "+%Y.%m.%d-%H:%M:%S%Z"`]$1 $2"; };info () { log "$GREEN INFO$RESET $1"; };warn () { log "$YELLOW WARN$RESET $1"; };error () { log "$RED ERROR$RESET $1"; };;if [ ! -z $CURL_CMD ]; then;info "Downloading eksctl";$SUDO curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp;info "Setting up at /usr/local/bin/eksctl";$SUDO mv /tmp/eksctl /usr/local/bin;$SUDO rm /tmp/eksctl;;else echo "Couldn't install package";exit 1;;fi; \ No newline at end of file diff --git a/installers/eksctl/installer.sh b/installers/eksctl/installer.sh new file mode 100644 index 0000000..5d64529 --- /dev/null +++ b/installers/eksctl/installer.sh @@ -0,0 +1,53 @@ +#!/bin/sh + +CURL_CMD=$(which curl) +YUM_CMD=$(which yum) +DNF_CMD=$(which dnf) +APT_GET_CMD=$(which apt-get) +PACMAN_CMD=$(which pacman) +APK_CMD=$(which apk) +GIT_CMD=$(which git) +SUDO_CMD=$(which sudo) + +USER="$(id -un 2>/dev/null || true)" +SUDO='' +if [ "$USER" != 'root' ]; then + if [ ! -z $SUDO_CMD ]; then + SUDO='sudo' + else + cat >&2 <<-'EOF' + Error: this installer needs the ability to run commands as root. + We are unable to find "sudo". Make sure its available to make this happen + EOF + exit 1 + fi +fi + +RESET='' +RED='' +GREEN='' +YELLOW='' +log () { + echo "[`date "+%Y.%m.%d-%H:%M:%S%Z"`]$1 $2" +} +info () { + log "$GREEN INFO$RESET $1" +} +warn () { + log "$YELLOW WARN$RESET $1" +} +error () { + log "$RED ERROR$RESET $1" +} + +if [ ! -z $CURL_CMD ]; then + info "Downloading eksctl" + $SUDO curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp + info "Setting up at /usr/local/bin/eksctl" + $SUDO mv /tmp/eksctl /usr/local/bin + $SUDO rm /tmp/eksctl + +else + echo "Couldn't install package" + exit 1; +fi \ No newline at end of file