File tree 4 files changed +46
-1
lines changed 4 files changed +46
-1
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ ; 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='[0m';RED='[0;31m';GREEN='[0;32m';YELLOW='[0;33m';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;;;
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ SUDO_CMD=$( which sudo)
4
+
5
+ USER=" $( id -un 2> /dev/null || true) "
6
+ SUDO=' '
7
+ if [ " $USER " != ' root' ]; then
8
+ if [ ! -z $SUDO_CMD ]; then
9
+ SUDO=' sudo'
10
+ else
11
+ cat >&2 << -'EOF '
12
+ Error: this installer needs the ability to run commands as root.
13
+ We are unable to find "sudo". Make sure its available to make this happen
14
+ EOF
15
+ exit 1
16
+ fi
17
+ fi
18
+
19
+ RESET=' [0m'
20
+ RED=' [0;31m'
21
+ GREEN=' [0;32m'
22
+ YELLOW=' [0;33m'
23
+ log () {
24
+ echo " [` date " +%Y.%m.%d-%H:%M:%S%Z" ` ]$1 $2 "
25
+ }
26
+ info () {
27
+ log " $GREEN INFO$RESET $1 "
28
+ }
29
+ warn () {
30
+ log " $YELLOW WARN$RESET $1 "
31
+ }
32
+ error () {
33
+ log " $RED ERROR$RESET $1 "
34
+ }
35
+
36
+ info " Downloading eksctl"
37
+ $SUDO curl --silent --location " https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$( uname -s) _amd64.tar.gz" | tar xz -C /tmp
38
+ info " Setting up at /usr/local/bin/eksctl"
39
+ $SUDO mv /tmp/eksctl /usr/local/bin
40
+ $SUDO rm /tmp/eksctl
41
+
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
- ;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='[0m';RED='[0;31m';GREEN='[0;32m';YELLOW='[0;33m';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
+ ;;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='[0m';RED='[0;31m';GREEN='[0;32m';YELLOW='[0;33m';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;
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
+
3
4
CURL_CMD=$( which curl)
4
5
YUM_CMD=$( which yum)
5
6
DNF_CMD=$( which dnf)
6
7
APT_GET_CMD=$( which apt-get)
7
8
PACMAN_CMD=$( which pacman)
8
9
APK_CMD=$( which apk)
9
10
GIT_CMD=$( which git)
11
+
10
12
SUDO_CMD=$( which sudo)
11
13
12
14
USER=" $( id -un 2> /dev/null || true) "
You can’t perform that action at this time.
0 commit comments