forked from pmalves/ctools-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ctools-installer.sh
executable file
·678 lines (536 loc) · 17.6 KB
/
ctools-installer.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
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
#!/bin/bash
INSTALLER=`basename "$0"`
VER='1.42'
echo
echo CTOOLS
echo
echo ctools-installer version $VER
echo
echo "Author: Pedro Alves (webdetails)"
echo Thanks to Analytical Labs for jenkins builds
echo Copyright Webdetails 2011
echo
echo
echo Changelog:
echo
echo v1.42 - Changed stable CGG download process
echo v1.41 - Changed dev CGG download process
echo v1.40 - Changed dev saiku download path
echo v1.39 - Changed saiku download path to 2.4
echo v1.38 - Added option -n for CBF integration
echo v1.37 - plugin-samples/cdv was not deleted. Fixed
echo v1.36 - CDV now installs samples too
echo v1.35 - Support for stable CDV, CDC and CDB installation
echo v1.34 - Support for CDV installation using -b dev switch
echo v1.33 - Added support for Saiku ad hoc stable \(release\) installations.
echo v1.32 - Added windows cr tolerance for this script\'s auto update
echo v1.31 - Support for CDB installation using -b dev switch
echo v1.30 - Support for CDC installation using -b dev switch
echo v1.29 - Changed saiku download path to 2.3
echo v1.28 - Support for CGG in 4.5, where webapp path is no longer required
echo v1.27 - Added support for CGG stable \( release \) installations.
echo v1.26 - -y flag now also works for ctools-installer update. ctools-installer update is now automated - Thanks to Mark Reid.
echo v1.25 - Removed overwrite, explicitly deleting marketplace definition
echo v1.24 - Added force overwrite to unzip to phase out overwrite confirmation
echo v1.23 - CDF trunk installation change due to js publish
echo v1.22 - Changed saiku download path to 2.2
echo v1.21 - Added support for CDE stable \(release\) installations.
echo v1.20 - CDF new samples location updated to stable installation.
echo v1.19 - Corrected installCDF and installCDE to remove samples dir before installing
echo v1.18 - CDA samples installation to plugin-samples also in stable mode.
echo v1.17 - Change to CDA and CDE samples installation. Now installs to folder plugin-samples instead of bi-developers \(for trunk snapshot only\).
echo v1.16 - Added support for CDC and Saiku-adhoc installation - for now only available in dev/trunk mode.
echo v1.15 - Change to CDF samples installation. Now installs to folder plugin-samples instead of bi-developers \(for trunk snapshot only\).
echo v1.14 - Added support for CDF stable \(release\) installations.
echo v1.13 - Fixed issue in CGG download
echo v1.12 - Fixed typo in -Y option
echo v1.11 - Added support for -y option \(assume yes\) - Thanks to Christian G. Warden
echo v1.10 - Added support for Saiku trunk snapshots installations.
echo v1.9 - Added support for CDA stable \(release\) installations.
echo v1.8 - Added CGG\; Script refactor
echo v1.7 - Changed url locations to new path of analytical labs
echo v1.6 - Changed saiku download path to 2.1
echo v1.5 - Changed default indicator values in prompts
echo v1.4 - Added Saiku for the list of installs
echo v1.3 - Added support for automatic updates
echo v1.2 - Silent mode for downloading
echo v1.1 - Minor bugfixes
echo v1.0 - First release
echo
echo
echo "Disclaimer: we can't be responsible for any damage done to your system, which hopefully will not happen"
echo Note: ctools-installer.sh will upgrade the plugins under system directory.
echo " Any changes you have made there (eg: cdf templates) will have to be backed up and manually copied after running the script"
echo " CGG will need to change the server WEB-INF/lib too. Backup your server"
echo
usage (){
echo
echo "Usage: ctools-installer.sh -s solutionPath [-w pentahoWebapPath] [-b branch]"
echo
echo "-s Solution path (eg: /biserver/pentaho-solutions)"
echo "-w Pentaho webapp server path (required for cgg on versions before 4.5. eg: /biserver-ce/tomcat/webapps/pentaho)"
echo "-b Branch from where to get ctools, stable for release, dev for trunk. Default is stable"
echo "-c Comma-separated list of CTools to install (Supported module-names: cdf,cda,cde,cgg,cdc,cdb,cdv,saiku,saikuadhoc)"
echo "-y Assume yes to all prompts"
echo "-n Add newline to end of prompts (for integration with CBF)"
echo "-h This help screen"
echo
exit 1
}
cleanup (){
rm -rf .tmp
}
# Parse options
[ $# -gt 1 ] || usage
SOLUTION_DIR='PATH' # Variable name
WEBAPP_PATH='PATH' # Show all matches (y/n)?
HAS_WEBAPP_PATH=0
BRANCH='stable'
ECHO_FLAG='-n'
MODULES=''
ASSUME_YES=false
ORIGINAL_CMDS=$@
while [ $# -gt 0 ]
do
case "$1" in
--) shift; break;;
-s) SOLUTION_DIR="$2"; shift;;
-w) WEBAPP_PATH="$2"; shift;;
-b) BRANCH="$2"; shift;;
-c) MODULES="$2"; shift;;
-y) ASSUME_YES=true;;
-n) ECHO_FLAG='';;
--) break;;
-*|-h) usage ;;
esac
shift
done
[ $SOLUTION_DIR = 'PATH' ] && usage
if [ $WEBAPP_PATH != 'PATH' ]
then
HAS_WEBAPP_PATH=1
fi
if [ $BRANCH != 'stable' ] && [ $BRANCH != 'dev' ]
then
echo ERROR: Branch must either be stable or dev
exit 1
fi
if [[ ! -d $SOLUTION_DIR ]]
then
echo ERROR: Supplied solution path is not a directory
exit 1
fi
if [[ ! -d $SOLUTION_DIR/system ]]
then
echo "ERROR: Supplied solution path doesn't look like a valid pentaho solutions directory. Missing system sub-directory."
exit 1
fi
if [[ $HAS_WEBAPP_PATH -eq 1 ]]
then
if [[ ! -d $WEBAPP_PATH/WEB-INF/lib ]]
then
echo "ERROR: Supplied webapp path doesn't look like a valid web application - missing WEB-INF/lib"
exit 1
fi
fi
for reqcmd in unzip wget
do
if [[ -z "$(which $reqcmd)" ]]
then
echo "ERROR: Missing required '$reqcmd' command."
exit 1
fi
done
URL1='-release'
FILESUFIX='-??.??.??'
if [ $BRANCH = 'dev' ]
then
URL1=''
FILESUFIX='-TRUNK-SNAPSHOT'
fi
# Checking for a new version
rm -rf .tmp
mkdir -p .tmp/dist
wget --no-check-certificate 'https://raw.github.com/pmalves/ctools-installer/master/ctools-installer.sh' -P .tmp -o /dev/null
if ! diff --strip-trailing-cr $0 .tmp/ctools-installer.sh >/dev/null ; then
answer=n
if $ASSUME_YES ; then
answer=y
else
echo
echo $ECHO_FLAG "There a new ctools-installer version available. Do you want to upgrade? (y/N) "
read -e answer < /dev/tty
fi
case $answer in
[Yy]* ) cp .tmp/ctools-installer.sh $0; echo "Upgrade successful. Rerunning command '$0 $ORIGINAL_CMDS'"; /bin/bash $0 $ORIGINAL_CMDS; exit 0;;
esac
fi
# Define download functions
downloadCDF (){
# CDF
URL='http://ci.analytical-labs.com/job/Webdetails-CDF'$URL1'/lastSuccessfulBuild/artifact/bi-platform-v2-plugin/dist/*zip*/dist.zip'
echo $ECHO_FLAG "Downloading CDF... "
wget --no-check-certificate $URL -P .tmp/dist/ -o /dev/null
rm -f .tmp/dist/marketplace.xml
unzip .tmp/dist/dist.zip -d .tmp > /dev/null
echo "Done"
}
downloadCDA (){
# CDA
URL='http://ci.analytical-labs.com/job/Webdetails-CDA'$URL1'/lastSuccessfulBuild/artifact/*zip*/archive.zip'
echo $ECHO_FLAG "Downloading CDA... "
wget --no-check-certificate $URL -P .tmp/cda -o /dev/null
rm -f .tmp/dist/marketplace.xml
unzip .tmp/cda/archive.zip -d .tmp > /dev/null
chmod -R +x .tmp/archive
echo "Done"
}
downloadCDE (){
# CDE
echo $ECHO_FLAG "Downloading CDE... "
wget --no-check-certificate 'http://ci.analytical-labs.com/job/Webdetails-CDE'$URL1'/lastSuccessfulBuild/artifact/server/plugin/dist/*zip*/dist.zip' -P .tmp/cde -o /dev/null
rm -f .tmp/dist/marketplace.xml
unzip .tmp/cde/dist.zip -d .tmp > /dev/null
echo "Done"
}
downloadCGG (){
# CGG
echo $ECHO_FLAG "Downloading CGG... "
wget --no-check-certificate 'http://ci.analytical-labs.com/job/Webdetails-CGG'$URL1'/lastSuccessfulBuild/artifact/*zip*/dist.zip' -P .tmp/cgg -o /dev/null
rm -f .tmp/dist/marketplace.xml
unzip .tmp/cgg/dist.zip -d .tmp > /dev/null
chmod -R +x .tmp/archive
echo "Done"
}
downloadCDC (){
# CDC
echo $ECHO_FLAG "Downloading CDC... "
wget --no-check-certificate 'http://ci.analytical-labs.com/job/Webdetails-CDC'$URL1'/lastSuccessfulBuild/artifact/dist/*zip*/dist.zip' -P .tmp/cdc -o /dev/null
rm -f .tmp/dist/marketplace.xml
unzip .tmp/cdc/dist.zip -d .tmp > /dev/null
echo "Done"
}
downloadCDB (){
# CDB
echo $ECHO_FLAG "Downloading CDB... "
wget --no-check-certificate 'http://ci.analytical-labs.com/job/Webdetails-CDB'$URL1'/lastSuccessfulBuild/artifact/dist/*zip*/dist.zip' -P .tmp/cdb -o /dev/null
rm -f .tmp/dist/marketplace.xml
unzip .tmp/cdb/dist.zip -d .tmp > /dev/null
echo "Done"
}
downloadCDV (){
# CDV
echo $ECHO_FLAG "Downloading CDV... "
wget --no-check-certificate 'http://ci.analytical-labs.com/job/Webdetails-CDV'$URL1'/lastSuccessfulBuild/artifact/dist/*zip*/dist.zip' -P .tmp/cdv -o /dev/null
rm -f .tmp/dist/marketplace.xml
unzip .tmp/cdv/dist.zip -d .tmp > /dev/null
echo "Done"
}
downloadSaiku (){
# SAIKU
echo $ECHO_FLAG "Downloading Saiku... "
#
#unzip .tmp/saiku/target.zip -d .tmp > /dev/null
# tamporarily switch for 2.1
if [ $BRANCH = 'dev' ]
then
wget --no-check-certificate 'http://ci.analytical-labs.com/job/saiku-bi-platform-plugin/lastSuccessfulBuild/artifact/saiku-bi-platform-plugin/target/*zip*/target.zip' -P .tmp/saiku -o /dev/null
rm -f .tmp/dist/marketplace.xml
unzip .tmp/saiku/target.zip -d .tmp > /dev/null
mv .tmp/target/saiku-* .tmp
else
wget --no-check-certificate 'http://analytical-labs.com/downloads/saiku-plugin-2.4.zip' -P .tmp -o /dev/null
fi
echo "Done"
}
downloadSaikuAdhoc (){
# SAIKU Adhoc
echo $ECHO_FLAG "Downloading Saiku Adhoc... "
#
#unzip .tmp/saiku/target.zip -d .tmp > /dev/null
# tamporarily switch for 2.1
if [ $BRANCH = 'dev' ]
then
wget --no-check-certificate 'http://ci.analytical-labs.com/job/saiku-adhoc-plugin/lastSuccessfulBuild/artifact/saiku-adhoc-plugin/target/*zip*/target.zip' -P .tmp/saiku-adhoc -o /dev/null
rm -f .tmp/dist/marketplace.xml
unzip .tmp/saiku-adhoc/target.zip -d .tmp > /dev/null
mv .tmp/target/saiku-adhoc-* .tmp
else
wget --no-check-certificate 'https://github.com/Mgiepz/saiku-reporting/raw/gh-pages/downloads/saiku-adhoc-plugin-1.0-GA.zip' -P .tmp/ -o /dev/null
fi
echo "Done"
}
# Define install functions
setupSamples() {
if [ ! -d $SOLUTION_DIR/plugin-samples ]
then
mkdir $SOLUTION_DIR/plugin-samples
fi
if [ ! -f $SOLUTION_DIR/plugin-samples/index.xml ]
then
echo '<index><visible>true</visible><name>Plugin Samples</name><description>Plugin Samples</description></index>' > $SOLUTION_DIR/plugin-samples/index.xml
fi
}
installCDF (){
rm -rf $SOLUTION_DIR/system/pentaho-cdf
# Removing samples dir. First two are deprecated
rm -rf $SOLUTION_DIR/bi-developers/cdf-samples
rm -rf $SOLUTION_DIR/plugin-samples/cdf-samples
rm -rf $SOLUTION_DIR/plugin-samples/pentaho-cdf
unzip .tmp/dist/pentaho-cdf$FILESUFIX.zip -d $SOLUTION_DIR/system/ > /dev/null
setupSamples
unzip .tmp/dist/pentaho-cdf-samples$FILESUFIX*zip -d $SOLUTION_DIR/plugin-samples/ > /dev/null
}
installCDE (){
rm -rf $SOLUTION_DIR/system/pentaho-cdf-dd
# Removing samples dir. First two are deprecated
rm -rf $SOLUTION_DIR/cde_sample
rm -rf $SOLUTION_DIR/plugin-samples/cde_sample
rm -rf $SOLUTION_DIR/plugin-samples/pentaho-cdf-dd
unzip .tmp/dist/pentaho-cdf-dd$FILESUFIX*zip -d $SOLUTION_DIR/system/ > /dev/null
setupSamples
unzip .tmp/dist/pentaho-cdf-dd-solution$FILESUFIX*zip -d $SOLUTION_DIR/plugin-samples > /dev/null
}
installCDA (){
rm -rf $SOLUTION_DIR/system/cda
# Removing samples dir. First is deprecated
rm -rf $SOLUTION_DIR/bi-developers/cda
rm -rf $SOLUTION_DIR/plugin-samples/cda
if [ $BRANCH = 'dev' ]
then
unzip .tmp/archive/cda-pentaho/dist/cda$FILESUFIX*zip -d $SOLUTION_DIR/system/ > /dev/null
else
unzip .tmp/archive/dist/cda$FILESUFIX*zip -d $SOLUTION_DIR/system/ > /dev/null
fi
setupSamples
if [ $BRANCH = 'dev' ]
then
unzip .tmp/archive/cda-pentaho/dist/cda-samples-*zip -d $SOLUTION_DIR/plugin-samples/ > /dev/null
else
unzip .tmp/archive/dist/cda-samples-*zip -d $SOLUTION_DIR/plugin-samples > /dev/null
fi
}
installCGG (){
rm -rf $SOLUTION_DIR/system/cgg
unzip .tmp/archive/cgg-pentaho/dist/cgg$FILESUFIX*zip -d $SOLUTION_DIR/system/ > /dev/null
# Changes to the server; 1 - delete batik; 2 - copy new one plus xml and fop
if [[ $HAS_WEBAPP_PATH -eq 1 ]]
then
LIB_DIR=$WEBAPP_PATH/WEB-INF/lib
CGG_DIR=$SOLUTION_DIR/system/cgg/lib
rm -rf $LIB_DIR/batik-* $LIB_DIR/xml-apis* $LIB_DIR/xmlgraphics*
cp $CGG_DIR/batik-[^j]* $CGG_DIR/xml* $LIB_DIR
else
echo
echo ' [CGG] No webapp path provided, if you are using pentaho older than 4.5 cgg will not work properly)'
fi
}
installCDC (){
rm -rf $SOLUTION_DIR/system/cdc
unzip .tmp/dist/cdc$FILESUFIX*zip -d $SOLUTION_DIR/system/ > /dev/null
# Changes to the server;
# 1 - copy hazelcast to WEB-INF/lib
LIB_DIR=$WEBAPP_PATH/WEB-INF/lib
CDC_HAZELCAST_DIR=$SOLUTION_DIR/system/cdc/pentaho-lib
rm -rf $LIB_DIR/hazelcast-*.jar
rm -rf $LIB_DIR/cdc-hazelcast-*.jar
cp $CDC_HAZELCAST_DIR/*.jar $LIB_DIR
}
installCDB (){
rm -rf $SOLUTION_DIR/system/cdb
unzip .tmp/dist/cdb$FILESUFIX*zip -d $SOLUTION_DIR/system/ > /dev/null
}
installCDV (){
rm -rf $SOLUTION_DIR/system/cdv
rm -rf $SOLUTION_DIR/plugin-samples/cdv
unzip .tmp/dist/cdv$FILESUFIX*zip -d $SOLUTION_DIR/system/ > /dev/null
setupSamples
unzip .tmp/dist/cdv-samples$FILESUFIX*zip -d $SOLUTION_DIR/plugin-samples/ > /dev/null
}
installSaiku (){
rm -rf $SOLUTION_DIR/system/saiku
unzip .tmp/saiku-plugin*zip -d $SOLUTION_DIR/system/ > /dev/null
}
installSaikuAdhoc (){
rm -rf $SOLUTION_DIR/system/saiku-adhoc
unzip .tmp/saiku-adhoc-plugin*zip -d $SOLUTION_DIR/system/ > /dev/null
}
# read options for stuff to download/install
INSTALL_CDF=0
INSTALL_CDA=0
INSTALL_CDE=0
INSTALL_CGG=0
INSTALL_CDC=0
INSTALL_CDB=0
INSTALL_CDV=0
INSTALL_SAIKU=0
INSTALL_SAIKU_ADHOC=0
if $ASSUME_YES; then
INSTALL_CDF=1
else
echo
echo $ECHO_FLAG "Install CDF? This will delete everything in $SOLUTION_DIR/system/pentaho-cdf. you sure? (y/N) "
read -e answer < /dev/tty
case $answer in
[Yy]* ) INSTALL_CDF=1;;
* ) ;;
esac
fi
if $ASSUME_YES; then
INSTALL_CDA=1
else
echo
echo $ECHO_FLAG "Install CDA? This will delete everything in $SOLUTION_DIR/system/cda. you sure? (y/N) "
read -e answer < /dev/tty
case $answer in
[Yy]* ) INSTALL_CDA=1;;
* ) ;;
esac
fi
if $ASSUME_YES; then
INSTALL_CDE=1
else
echo
echo $ECHO_FLAG "Install CDE? This will delete everything in $SOLUTION_DIR/system/pentaho-cdf-dd. you sure? (y/N) "
read -e answer < /dev/tty
case $answer in
[Yy]* ) INSTALL_CDE=1;;
* ) ;;
esac
fi
if $ASSUME_YES; then
INSTALL_CGG=1
else
echo
echo $ECHO_FLAG "Install CGG? This will delete everything in $SOLUTION_DIR/system/cgg. you sure? (y/N) "
read -e answer < /dev/tty
case $answer in
[Yy]* ) INSTALL_CGG=1;;
* ) ;;
esac
fi
if [[ $HAS_WEBAPP_PATH -eq 1 ]]
then
if $ASSUME_YES; then
INSTALL_CDC=1
else
echo
echo $ECHO_FLAG "Install CDC? This will delete everything in $SOLUTION_DIR/system/cdc. you sure? (y/N) "
read -e answer < /dev/tty
case $answer in
[Yy]* ) INSTALL_CDC=1;;
* ) ;;
esac
fi
else
echo
echo 'No webapp path provided, will not install CDC'
fi
if $ASSUME_YES; then
INSTALL_CDB=1
else
echo
echo $ECHO_FLAG "Install CDB? This will delete everything in $SOLUTION_DIR/system/cdb. you sure? (y/N) "
read -e answer < /dev/tty
case $answer in
[Yy]* ) INSTALL_CDB=1;;
* ) ;;
esac
fi
if $ASSUME_YES; then
INSTALL_CDV=1
else
echo
echo $ECHO_FLAG "Install CDV? This will delete everything in $SOLUTION_DIR/system/cdv. you sure? (y/N) "
read -e answer < /dev/tty
case $answer in
[Yy]* ) INSTALL_CDV=1;;
* ) ;;
esac
fi
if $ASSUME_YES; then
INSTALL_SAIKU=1
else
echo
echo $ECHO_FLAG "Install Saiku? This will delete everything in $SOLUTION_DIR/system/saiku. you sure? (y/N) "
read -e answer < /dev/tty
case $answer in
[Yy]* ) INSTALL_SAIKU=1;;
* ) ;;
esac
fi
if $ASSUME_YES; then
INSTALL_SAIKU_ADHOC=1
else
echo
echo $ECHO_FLAG "Install Saiku Adhoc? This will delete everything in $SOLUTION_DIR/system/saiku-adhoc. you sure? (y/N) "
read -e answer < /dev/tty
case $answer in
[Yy]* ) INSTALL_SAIKU_ADHOC=1;;
* ) ;;
esac
fi
nothingToDo (){
echo Nothing to do. Exiting
cleanup
exit 1
}
if [ "$MODULES" != "" ]; then
INSTALL_CDF=0
INSTALL_CDA=0
INSTALL_CDE=0
INSTALL_CGG=0
INSTALL_CDC=0
INSTALL_CDB=0
INSTALL_CDV=0
INSTALL_SAIKU=0
INSTALL_SAIKU_ADHOC=0
MODULES_ARR=$(echo $MODULES | tr "," "\n")
for MODULE in $MODULES_ARR
do
case $MODULE in
cdf) INSTALL_CDF=1;;
cda) INSTALL_CDA=1;;
cde) INSTALL_CDE=1;;
cgg) INSTALL_CGG=1;;
cdc) INSTALL_CDC=1;;
cdb) INSTALL_CDB=1;;
cdv) INSTALL_CDV=1;;
saiku) INSTALL_SAIKU=1;;
saikuadhoc) INSTALL_SAIKU_ADHOC=1;;
* ) ;;
esac
done
fi
[ $INSTALL_CDF -ne 0 ] || [ $INSTALL_CDE -ne 0 ] || [ $INSTALL_CDA -ne 0 ] || [ $INSTALL_CGG -ne 0 ] || [ $INSTALL_CDC -ne 0 ] || [ $INSTALL_CDB -ne 0 ] || [ $INSTALL_CDV -ne 0 ] || [ $INSTALL_SAIKU -ne 0 ] || [ $INSTALL_SAIKU_ADHOC -ne 0 ] || nothingToDo
# downloading files
echo
echo Downloading files
echo
[ $INSTALL_CDF -eq 0 ] || downloadCDF
[ $INSTALL_CDA -eq 0 ] || downloadCDA
[ $INSTALL_CDE -eq 0 ] || downloadCDE
[ $INSTALL_CGG -eq 0 ] || downloadCGG
[ $INSTALL_CDC -eq 0 ] || downloadCDC
[ $INSTALL_CDB -eq 0 ] || downloadCDB
[ $INSTALL_CDV -eq 0 ] || downloadCDV
[ $INSTALL_SAIKU -eq 0 ] || downloadSaiku
[ $INSTALL_SAIKU_ADHOC -eq 0 ] || downloadSaikuAdhoc
# installing files
echo
echo Installing files
echo
[ $INSTALL_CDF -eq 0 ] || installCDF
[ $INSTALL_CDA -eq 0 ] || installCDA
[ $INSTALL_CDE -eq 0 ] || installCDE
[ $INSTALL_CGG -eq 0 ] || installCGG
[ $INSTALL_CDC -eq 0 ] || installCDC
[ $INSTALL_CDB -eq 0 ] || installCDB
[ $INSTALL_CDV -eq 0 ] || installCDV
[ $INSTALL_SAIKU -eq 0 ] || installSaiku
[ $INSTALL_SAIKU_ADHOC -eq 0 ] || installSaikuAdhoc
cleanup
echo
echo Done!
echo
exit 0