Skip to content

Commit

Permalink
nginx installation script
Browse files Browse the repository at this point in the history
  • Loading branch information
vibhorgupta-gh committed Feb 25, 2019
1 parent 66fd213 commit 0b62667
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 0b62667

Please sign in to comment.