Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: nginx installation script #15

Merged
merged 1 commit into from
Jul 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions installers/nginx/installer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

YUM_CMD=$(which yum) # yum package manager for RHEL & CentOS
DNF_CMD=$(which dnf) # dnf package manager for new RHEL & CentOS
APT_GET_CMD=$(which apt-get) # apt package manager for Ubuntu & other Debian based distributions
PACMAN_CMD=$(which pacman) # pacman package manager for ArchLinux
APK_CMD=$(which apk) # apk package manager for Alpine

if [ ! -z $APT_GET_CMD ]; then
sudo apt-get update
sudo apt-get install nginx
elif [ ! -z $DNF_CMD ]; then
sudo dnf install nginx
elif [ ! -z $YUM_CMD ]; then
sudo yum install nginx
elif [ ! -z $PACMAN_CMD ]; then
sudo pacman -S nginx
elif [ 1 -z $APK_CMD ]; then
sudo apk update
sudo apk add nginx
else
echo "Couldn't install package"
exit 1;
fi

nginx -v