diff --git a/installers/eksctl/installer.curl.min.sh b/installers/eksctl/installer.curl.min.sh new file mode 100644 index 0000000..da92b83 --- /dev/null +++ b/installers/eksctl/installer.curl.min.sh @@ -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;;; \ No newline at end of file diff --git a/installers/eksctl/installer.curl.sh b/installers/eksctl/installer.curl.sh new file mode 100644 index 0000000..f094112 --- /dev/null +++ b/installers/eksctl/installer.curl.sh @@ -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 + diff --git a/installers/eksctl/installer.min.sh b/installers/eksctl/installer.min.sh index 5bc4b49..1e055d1 100644 --- a/installers/eksctl/installer.min.sh +++ b/installers/eksctl/installer.min.sh @@ -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; \ No newline at end of file +;;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 index 5d64529..e33033b 100644 --- a/installers/eksctl/installer.sh +++ b/installers/eksctl/installer.sh @@ -1,5 +1,6 @@ #!/bin/sh + CURL_CMD=$(which curl) YUM_CMD=$(which yum) DNF_CMD=$(which dnf) @@ -7,6 +8,7 @@ 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)"