-
Notifications
You must be signed in to change notification settings - Fork 1
/
install
executable file
·85 lines (76 loc) · 2.25 KB
/
install
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/env bash
DBG=0
DEF=0
# get os
if [ -f /etc/oracle-release ]; then
export LXTYPE=RHEL
elif [ -f /etc/redhat-release ]; then
export LXTYPE=RHEL
elif [ -f /etc/SuSE-release ]; then
export LXTYPE=SUSE
elif [ -f /etc/SUSE-brand ]; then
export LXTYPE=SUSE
elif [ -f /etc/debian_version ]; then
export LXTYPE=DEBIAN
elif [ -f /etc/gentoo-release ]; then
export LXTYPE=GENTOO
fi
if [ $LXTYPE == "RHEL" ]; then
# RHEL variant -
if [ -f /etc/os-release ]; then
RHID=`grep '^ID=' /etc/os-release|awk -F= '{ print $2 }' | tr -d \"`
RREL=`grep '^VERSION_ID=' /etc/os-release | awk -F= '{ print $2 }' | tr -d \" | cut -c1-1`
else
# looks like an older release
RAWVER=`cat /etc/redhat-release`
RREL=`echo $RAWVER|tr -d [A-Za-z\(\)]|tr -d " "|awk -F\. ' { print $1 }'`
RHID=`echo $RAWVER|tr -d [0-9\(\)]|awk '{print $1 }'| tr [A-Z] [a-z]`
fi
if [ $DBG -ne 0 ]; then
echo
echo "### DEBUG ###"
echo "redhat-release: $RAWVER"
echo "VERSION_ID from os-release: $RHID"
echo "ID from os-release: $RREL"
echo "installer: ${RHID}-${RREL}.sh"
echo "### DEBUG ###"
echo
fi
if [ $RHID == 'ol' ];
then
RHID=oracle
RREL=`echo $RREL | awk -F\. '{ print $1 }'`
fi
if [ -f installers/${RHID}-${RREL}.sh ]; then
DEF=1
echo "copy & paste the following command to begin the install:"
echo
echo " bash installers/${RHID}-${RREL}.sh | tee installer.log 2>&1"
echo
fi
fi
if [ $LXTYPE == "DEBIAN" ]; then
ID=`grep ^ID= /etc/os-release | awk -F\= '{ print $2 }'`
VER=`grep ^VERSION_ID= /etc/os-release | awk -F\= '{ print $2 }'| tr -d \"`
if [ -f installers/${ID}-${VER}.sh ]; then
DEF=1
echo "copy & paste the following command to begin the install:"
echo
echo " bash installers/${ID}-${VER}.sh | tee installer.log 2>&1"
echo
fi
if [ $DBG -ne 0 ]; then
echo
echo "### DEBUG ###"
echo "Debian or derivative detected:"
echo "RVER = $RVER"
echo "$ID version $VER"
echo "### DEBUG ###"
echo
fi
fi
if [ $DEF == 0 ]; then
echo "$LXTYPE type system detected, you can try the installer that seems"
echo "most closely related to yours (scripts in the installers directory)"
echo "or refer to manual-install.txt for generic install procedures"
fi