Skip to content

Commit

Permalink
Update installer scripts, README.md & installers.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
Heshdude authored Aug 16, 2020
1 parent 867d50d commit cfa0f7d
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 1 deletion.
2 changes: 2 additions & 0 deletions installers/eksctl/installer.curl.min.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
;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"; };;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;;;
41 changes: 41 additions & 0 deletions installers/eksctl/installer.curl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/sh

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"
}

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

2 changes: 1 addition & 1 deletion installers/eksctl/installer.min.sh
Original file line number Diff line number Diff line change
@@ -1,2 +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;
;;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;
2 changes: 2 additions & 0 deletions installers/eksctl/installer.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/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)"
Expand Down

0 comments on commit cfa0f7d

Please sign in to comment.