-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcheckVersions.sh
More file actions
executable file
·62 lines (46 loc) · 2.21 KB
/
Copy pathcheckVersions.sh
File metadata and controls
executable file
·62 lines (46 loc) · 2.21 KB
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
#!/bin/bash
# ********************************************************************************
# This script checks for and reports incompatible version numbers in the
# linux command lines that are needed for the tranSAMRT install and data loading
# ********************************************************************************
# # ------------------ source helper function -------------------
. ./versionCompare.sh
# ---------------------------
# Check the version of those command line element that need specific versions
# ---------------------------
echo "-------------------------------------"
echo "| Checking for incompatible version of basic command-line tools;"
echo "| If any problems are reported, then recheck the instructions, "
echo "| and install or re-installing the missing items"
echo "-------------------------------------"
# Just in case this is run after the load, without a new login
# sets up grails and groovy; normally in profile for login
source $HOME/.sdkman/bin/sdkman-init.sh
returnFlag=0
# check java version, 1.7 or higher
desiredjavaVersion="1.7"
javaVersion=$(java -version 2>&1 | awk -F '"' '{print $2}')
reportCheckOrHigher "java" $desiredjavaVersion $javaVersion
let "returnFlag=$returnFlag + $?"
# check php version, 5.4 or higher
desiredPhpVersion="5.4"
phpVersion=$(php --version | awk -F '^PHP ' '{print $2}' | awk -F 'ubuntu' '{print $1}')
reportCheckOrHigher "php" $desiredPhpVersion $phpVersion
let "returnFlag=$returnFlag + $?"
# check psql version, 9.2 or higher
desiredPsqlVersion="9.2"
version=$(psql --version)
psqlVersion=$( echo "$version" | awk -F '^psql .PostgreSQL. ' '{print $2}')
reportCheckOrHigher "psql" $desiredPsqlVersion $psqlVersion
let "returnFlag=$returnFlag + $?"
# check groovy version, 2.1 or higher
desiredGroovyVersion="2.1"
groovyVersion=$(groovy --version | awk -F '^Groovy Version: ' '{print $2}')
reportCheckOrHigher "groovy" $desiredGroovyVersion $groovyVersion
let "returnFlag=$returnFlag + $?"
# check grails version, exactly 2.3.11
desiredGrailsVersion="2.3.11"
grailsVersion=$(sdk current grails | awk -F '^Using grails version ' '{print $2}')
reportCheckExact "grails" $desiredGrailsVersion $grailsVersion
let "returnFlag=$returnFlag + $?"
exit $returnFlag