forked from CFD-GO/TCLB_cluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchecks.bash
56 lines (49 loc) · 879 Bytes
/
checks.bash
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
function GRANT_CHECK {
if [ -z "$GRANT" ]
then
echo No grant provided.
return 1
fi
if ! checkgrant $GRANT
then
echo No such grant: $GRANT
return 1
fi
return 0
}
function TCLB_CHECK {
if [ ! -d "$TCLB/src" ]
then
echo there is no src subdirectory - something is wrong
echo file not found: $TCLB/src
return 1;
else
TCLB=$(cd $TCLB; pwd)
fi
return 0
}
function RHOME_CHECK {
if [ ! -f "$RHOME/bin/R" ]
then
echo R not found in $RHOME/bin/
return 1
fi
return 0
}
function MODULES_CHECK {
for i in $@
do
if [ -z "$(module av $i 2>&1)" ]
then
echo there is no module $i
return 1;
fi
done
return 0;
}
function MODULES_RUN_CHECK {
MODULES_CHECK $MODULES_RUN
}
function MODULES_ADD_CHECK {
MODULES_CHECK $MODULES_ADD
}