File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ YUM_CMD=$( which yum) # yum package manager for RHEL & CentOS
4
+ DNF_CMD=$( which dnf) # dnf package manager for new RHEL & CentOS
5
+ APT_GET_CMD=$( which apt-get) # apt package manager for Ubuntu & other Debian based distributions
6
+ PACMAN_CMD=$( which pacman) # pacman package manager for ArchLinux
7
+ APK_CMD=$( which apk) # apk package manager for Alpine
8
+
9
+ if [ ! -z $APT_GET_CMD ]; then
10
+ sudo apt-get update
11
+ sudo apt-get install nginx
12
+ elif [ ! -z $DNF_CMD ]; then
13
+ sudo dnf install nginx
14
+ elif [ ! -z $YUM_CMD ]; then
15
+ sudo yum install nginx
16
+ elif [ ! -z $PACMAN_CMD ]; then
17
+ sudo pacman -S nginx
18
+ elif [ 1 -z $APK_CMD ]; then
19
+ sudo apk update
20
+ sudo apk add nginx
21
+ else
22
+ echo " Couldn't install package"
23
+ exit 1;
24
+ fi
25
+
26
+ nginx -v
You can’t perform that action at this time.
0 commit comments