-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
42 lines (40 loc) · 876 Bytes
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
#Run this script as root.
APT_GET=$(which apt-get)
APT=$(which apt)
YUM=$(which yum)
DNF=$(which dnf)
PKG=$(which pkg)
MAKE=$(which make)
PACMAN=$(which pacman)
if [[ ! -z $YUM ]]; then
yum check-update
yum install - < requirements.txt
exit 1;
elif [[ ! -z $APT_GET ]]; then
apt-get update
apt-get install - < requirements.txt
exit 1;
elif [[ ! -z $APT ]]; then
apt update
apt install - < requirements.txt
elif [[ ! -z $DNF ]]; then
dnf check-update
dnf install - < requirements.txt
exit 1;
elif [[ ! -z $PKG ]]; then
pkg update
pkg install - < requirements.txt
exit 1;
elif [[ ! -z $PACMAN ]]; then
pacman -Syu
pacman -S - < requirements.txt
exit 1;
elif [[ ! -z $MAKE ]]; then
make update
make install - < requirements.txt
exit 1;
else
echo "Cannot install the packages! Try to install them manually."
exit 1;
fi