Skip to content

Commit 0d8b8f2

Browse files
authored
Merge pull request #48 from Heshdude/update-readme-md-and-installers-toml-36
Update installer scripts, README.md & installers.toml for #36
2 parents a368877 + cfa0f7d commit 0d8b8f2

File tree

4 files changed

+46
-1
lines changed

4 files changed

+46
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
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='';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;;;

installers/eksctl/installer.curl.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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=''
20+
RED=''
21+
GREEN=''
22+
YELLOW=''
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+

installers/eksctl/installer.min.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/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='';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+
;;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;

installers/eksctl/installer.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#!/bin/sh
22

3+
34
CURL_CMD=$(which curl)
45
YUM_CMD=$(which yum)
56
DNF_CMD=$(which dnf)
67
APT_GET_CMD=$(which apt-get)
78
PACMAN_CMD=$(which pacman)
89
APK_CMD=$(which apk)
910
GIT_CMD=$(which git)
11+
1012
SUDO_CMD=$(which sudo)
1113

1214
USER="$(id -un 2>/dev/null || true)"

0 commit comments

Comments
 (0)