Skip to content

Commit

Permalink
Merge pull request #15 from VibhorCodecianGupta/nginx
Browse files Browse the repository at this point in the history
Add: nginx installation script
  • Loading branch information
agentmilindu authored Jul 28, 2019
2 parents 80a6cb9 + 0b62667 commit 6c11a05
Showing 1 changed file with 26 additions and 0 deletions.
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

0 comments on commit 6c11a05

Please sign in to comment.