Skip to content

Commit

Permalink
Merge pull request #22 from Heshdude/update-readme-md-and-installers-…
Browse files Browse the repository at this point in the history
…toml

Update README.md & installers.toml
  • Loading branch information
Heshdude authored Aug 8, 2020
2 parents 84b817b + 2152cd2 commit 40e7e6b
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 27 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ This will install Git on your machine!
<!-- beginning of tools list -->
| Tool |Apt|Yum|Packman|APK|DNF|CURL| URL |
|--------|---|---|-------|---|---|----|----------------------------|
|Git |Yes|Yes|Yes |Yes|Yes|No |https://installer.to/git |
|Hello |Yes|Yes|Yes |Yes|Yes|Yes |https://installer.to/hello |
|NodeJS |Yes|Yes|No |Yes|Yes|No |https://installer.to/node |
|Python 3|Yes|Yes|Yes |Yes|Yes|No |https://installer.to/python3|
|Nginx |Yes|Yes|Yes |Yes|Yes|No |https://installer.to/nginx |
|Git |Yes|Yes|Yes |Yes|Yes|No |https://installer.to/git |
|gCloud |No |No |No |No |No |Yes |https://installer.to/gcloud |
|Docker |Yes|Yes|No |No |No |No |https://installer.to/docker |
|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 |
|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|

<!-- end of tools list -->
49 changes: 27 additions & 22 deletions installers.toml
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
[node]
installers = "apt,yum,dnf,apk"
name = "NodeJS"

[git]
name = "Git"
installers = "apt,yum,pacman,dnf,apk"
name = "Git"
description = "Git SVM"

[hello]
name = "Hello"
installers = "apt,yum,pacman,apk,dnf,curl"
description = "This is just a sample tool"

[node]
name = "NodeJS"
installers = "apt,yum,dnf,apk"

[python3]
name = "Python 3"
description = "Python 3"
installers = "apt,yum,pacman,apk,dnf"
[gcloud]
installers = "curl"
name = "gCloud"
description = "CLI tool of GCP"

[nginx]
installers = "apt,yum,pacman,apk,dnf"
name = "Nginx"
description = "Nginx server"
installers = "apt,yum,pacman,apk,dnf"

[gcloud]
name = "gCloud"
description = "CLI tool of GCP"
[hlf]
installers = "curl"
name = "Fabric"
description = "Hyperledger Fabric"

[docker]
installers = "apt,yum"
name = "Docker"
description = "Docker"
installers = "apt,yum"

[hlf]
name = "Fabric"
description = "Hyperledger Fabric"
[ctop]
installers = "curl"
name = "cTop"
description = "Top-like interface for container metrics"

[hello]
installers = "apt,yum,pacman,apk,dnf,curl"
name = "Hello"
description = "This is just a sample tool"

[python3]
installers = "apt,yum,pacman,apk,dnf"
name = "Python 3"
description = "Python 3"
2 changes: 2 additions & 0 deletions installers/ctop/installer.min.sh
Original file line number Diff line number Diff line change
@@ -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 cTop ........";$SUDO curl -sSL https://github.com/bcicen/ctop/releases/download/v0.7.3/ctop-0.7.3-linux-amd64 -O /usr/local/bin/ctop;info "Setting up at /usr/local/bin/ctop";$SUDO chmod +x /usr/local/bin/ctop;;else echo "Couldn't install package";exit 1;;fi;
52 changes: 52 additions & 0 deletions installers/ctop/installer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/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 cTop ........"
$SUDO curl -sSL https://github.com/bcicen/ctop/releases/download/v0.7.3/ctop-0.7.3-linux-amd64 -O /usr/local/bin/ctop
info "Setting up at /usr/local/bin/ctop"
$SUDO chmod +x /usr/local/bin/ctop

else
echo "Couldn't install package"
exit 1;
fi

0 comments on commit 40e7e6b

Please sign in to comment.