-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstallSAP.sh
2321 lines (2048 loc) · 109 KB
/
installSAP.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
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env sh
################################################################################
#
# install_SAP.sh
#
# Version: 3.9
# RS 2016/08/05 01:35 PM
#
#
# - mount software-depot from fileserver
# - prepare host to run SAP
# - conduct SAP installation
# - check SAP installation
#
#
# CHANGELOG
# 3.9
# - refactoring of function _prepare_sap_infrastructure
# - refactoring of error handling (function _exit_on_error)
# - refactoring and renaming function _prepare_process_xslt to _determine_sap_product_id
# - new function to manipulate SAP profiles
# - Oracle autostart (init)
# - set autostart=y for HDB
# - improved fstab handling
# - included possibility to install HDB and SAP on the same host
# - moved sanity_check for scrGlobalHost into SAP section
# - provide the option to run sapinst until summary phase using scrDryRun
# - include Secure Storage Key Generation
# - remove spaces from local_input.ini
# - changed scrSapFlavour into scrSapStack
# - replace makeProperEtcHosts.awk file with three simple sed commands
# - delete obsolete function prepareInputParamIni
# - consistent file names for temporary or backup files
# - moving sapinst_instdir to sapinst_instdir.$$
# - implemented workaround for MCOD installation with Oracle
# - fix for DB-user Names now using DBSID
# - refined the section for calling OUI. removed temporary file OO-ora.log
# 3.8
# - including Doublestack
# - deleting DBSIZE.XML check for Sybase
# - new option to use inifile.params
# - new option to stop the installation at summary phase
# - Uncomment createDBFolders
# - important variables in inifile will be set to local_input.ini values
# - Check for running sapinst
# - Introduced DB-SID
# - Entered Database Schema for Java
# - HDB Config file working
# - complete AAS for all DBs
# - Modified Oracle Installation. DatabaseSchema is now set by inifile.params
#
# 3.7.1
# - support for SAP NW 7.5 and SAP Business Suite 2016
# - changed the sapinst parameter options
#
# 3.7
# - fixed SAP installation with Oracle
# - refactoring the _check_db_status() function
# - refactoring the functionality for mounting the global host share
# - removed the mounting of shared HANA directory
# - refactoring the script to be POSIX compliant
# - change shebang from #!/bin/sh to #!/usr/bin/env sh
# - removed deprecated JCEPolicyFile
# - updated HostFunctions to be consistent with SAP instance naming
# standard, ascs, scs, db, pas, aas
# - fixed missing SCS support for Java installations
# - removed old variables (backward compatibility)
# - added option for length and characters of the random password
# - removed old or not used functions
# - code cleanup
# - adjusted makeProperEtcHosts function
#
# 3.6
# - code cleanup
# - fixed some problems
# - changed from hdbinst to hdblcm for HANA deployments
# - support for S/4HANA on-premise 1511 (official release)
#
# 3.5
# - support for S/4HANA on-premise 1511 (internal release)
#
# 3.3
# - adjusted naming of host functions
#
# 3.2
# - added support for S/4HANA
#
# 3.1
# - added support for HANA Database installations (TDI)
#
# 3.0
# - added support for Business Suite on HANA and S/4HANA installations
#
# 2.0
# - removed HP-UX support
# - new processing of Product-ID
# - improved handling of sapinst
# - SWPM required
#
# 1.1
# - update to support 70-SWPM
# - automatic OS configuration LX
# - Kernel 3.0 support SLES11-SP2
# - rewrite of sapinst section
#
# 1.0
# - initial release built out of OO workflow operations
# and other already existing scripts
#
################################################################################
################################################################################
# Add sapinst group
################################################################################
_add_sapinst_group()
{
grep -q sapinst /etc/group || echo "sapinst:x:1000:root" >> /etc/group
}
################################################################################
# Add HPE header long
################################################################################
_add_hpe_header_long()
{
echo "#-----------------------------------------------------------------------"
_add_hpe_header_short
echo "#-----------------------------------------------------------------------"
}
################################################################################
# Add HPE header short
################################################################################
_add_hpe_header_short()
{
echo "# Added by HPE Automated Installation"
}
################################################################################
# Attach the global host
################################################################################
#_attach_global_host()
#{
# ${ECHO} "$(date)\t Attaching Global Host." >> "${DEV_LOG}"
# grep -q HPE /etc/fstab || _add_hpe_header_long >> /etc/fstab
# if [ "$scrMultipleOS" = "true" ]; then
# mountlist="global profile"
# ${ECHO} "$(date)\t Heterogeneous Installation. Mounting ==>${mountlist}<==" >> "${DEV_LOG}"
# else
# mountlist="exe global profile"
# ${ECHO} "$(date)\t Homogeneous Installation. Mounting ==>${mountlist}<==" >> "${DEV_LOG}"
# fi
# for dir in ${mountlist}; do
# [ -d "${SAPMNT_MOUNTPOINT}/${scrSID}/${dir}" ] || mkdir -p "${SAPMNT_MOUNTPOINT}/${scrSID}/${dir}"
# mount | grep -q "${SAPMNT_MOUNTPOINT}/${scrSID}/${dir}"
# if [ "$?" -ne 0 ]; then
# ${ECHO} "$(date)\t 'mount -o rsize=32768,wsize=32768 ${scrGlobalHost}:${SAPMNT_MOUNTPOINT}/${scrSID}/${dir} ${SAPMNT_MOUNTPOINT}/${scrSID}/${dir} >/dev/null 2>&1'" >> "${DEV_LOG}"
# mount -o rsize=32768,wsize=32768 "${scrGlobalHost}:${SAPMNT_MOUNTPOINT}/${scrSID}/${dir}" "${SAPMNT_MOUNTPOINT}/${scrSID}/${dir}" >/dev/null 2>&1
# [ "$?" -ne 0 ] && _exit_on_error "MOUNT_ERROR - Could not mount central share. Mount of ${scrGlobalHost}:${SAPMNT_MOUNTPOINT}/${scrSID}/${dir} went wrong!" "${LINENO}"
# fi
# grep -q "${SAPMNT_MOUNTPOINT}/${scrSID}/${dir}" /etc/fstab
# [ "$?" -ne 0 ] && echo "${scrGlobalHost}:${SAPMNT_MOUNTPOINT}/${scrSID}/${dir} ${SAPMNT_MOUNTPOINT}/${scrSID}/${dir} nfs defaults,rsize=32768,wsize=32768 0 0" >> /etc/fstab
# done
# # Sanity check
# for dir in ${mountlist}; do
# mount | grep -iq "${scrGlobalHost}:${SAPMNT_MOUNTPOINT}/${scrSID}/${dir}" || _exit_on_error "MOUNTCHECK_ERROR - One ore more central shares not mounted. ${scrGlobalHost}:${SAPMNT_MOUNTPOINT}/${scrSID}/${dir} not mounted!" "${LINENO}"
# done
# }
################################################################################
# Check DB Status
################################################################################
_check_db_status()
{
DB_ONLINE=false
case "${scrDatabaseVendor}" in
ADA)
su - "${SQDSID}" -c 'dbmcli -U c db_state' | grep -q ONLINE && DB_ONLINE=true
;;
DB6)
su - "${DB2SID}" -c 'db2pd -' | grep -q Active && DB_ONLINE=true
;;
HDB)
# ToDo: check HDB with: sapcontrol -host RH0ac9c7fc21 -nr 00 -function GetProcessList
su - "${SIDADM_HDB}" -c 'HDB info' | grep -q hdbxsengine && DB_ONLINE=true
;;
ORA)
ps -ef | grep pmon | grep -q "${scrSID}" && DB_ONLINE=true
;;
SYB)
ps -ef | grep dataserver | grep -q "${scrSID}" && DB_ONLINE=true
;;
*)
_exit_on_error "UNKNOWN_DB_VENDOR - '${scrDatabaseVendor}' not supported." "${LINENO}"
;;
esac
}
################################################################################
# Check /etc/hosts
################################################################################
_check_etc_hosts()
{
${ECHO} "$(date)\t Make proper '/etc/hosts' file" >> "${INSTALLATION_LOG}"
[ "${INSTALL_SAP_OR_HDB}" = "hdb" ] && host="${HOSTNAME_HDB}" || host="${HOSTNAME}"
header=$( _add_hpe_header_short )
sed -i "s/^\(127\.0\.0\.1\).*${host}.*/${header}\n#&\n\1\tlocalhost/gi" /etc/hosts
sed -i "s/^127\..*${host}.*/${header}\n#&/gi" /etc/hosts
sed -i "s/^\(::1\).*${host}.*/${header}\n#&\n\1\t\tlocalhost/gi" /etc/hosts
}
################################################################################
# Check for NFS Server
################################################################################
#_check_nfs_server()
{
if [ "${scrHostFunction}" = "standard" ] || [ "${scrHostFunction}" = "ascs" ] || [ "${scrHostFunction}" = "scs" ] || [ "${INSTALL_SAP_OR_HDB}" = "hdb" ]; then
${ECHO} "$(date)\t Checking for Kernel NFS server" >> "${INSTALLATION_LOG}"
# check if nfs server is installed
[ "${DISTRO}" = "RHEL" ] && _check_packages 'rpcbind nfs-utils'
[ "${DISTRO}" = "SLES" ] && _check_packages 'rpcbind nfs-kernel-server'
# ensure rpcbind and nfs-server services are enabled and running
if [ "${DISTRO_VERSION}" = "RHEL6" ]; then
chkconfig rpcbind on >/dev/null || _exit_on_error "ERROR_RPCBIND_ENABLE - Error enabling 'rpcbind' service!" "${LINENO}"
service rpcbind start >/dev/null || _exit_on_error "ERROR_RPCBIND_START - Error starting 'rpcbind' service!" "${LINENO}"
chkconfig nfs on >/dev/null || _exit_on_error "ERROR_NFS_ENABLE - Error enabling 'nfs' service!" "${LINENO}"
service nfs start >/dev/null || _exit_on_error "ERROR_NFS_START - Error starting 'nfs' service!" "${LINENO}"
elif [ "${DISTRO_VERSION}" = "SLES11" ]; then
chkconfig rpcbind on >/dev/null || _exit_on_error "ERROR_RPCBIND_ENABLE - Error enabling 'rpcbind' service!" "${LINENO}"
service rpcbind start >/dev/null || _exit_on_error "ERROR_RPCBIND_START - Error starting 'rpcbind' service!" "${LINENO}"
chkconfig nfsserver on >/dev/null || _exit_on_error "ERROR_NFSSERVER_ENABLE - Error enabling 'nfsserver' service!" "${LINENO}"
service nfsserver start >/dev/null || _exit_on_error "ERROR_NFSSERVER_START - Error starting 'nfsserver' service!" "${LINENO}"
elif [ "${DISTRO_VERSION}" = "RHEL7" ] || [ "${DISTRO_VERSION}" = "SLES12" ]; then
systemctl enable rpcbind >/dev/null || _exit_on_error "ERROR_RPCBIND_ENABLE - Error enabling 'rpcbind' service!" "${LINENO}"
systemctl start rpcbind >/dev/null || _exit_on_error "ERROR_RPCBIND_START - Error starting 'rpcbind' service!" "${LINENO}"
systemctl enable nfs-server >/dev/null || _exit_on_error "ERROR_NFSSERVER_ENABLE - Error enabling 'nfs-server' service!" "${LINENO}"
systemctl start nfs-server >/dev/null || _exit_on_error "ERROR_NFSSERVER_START - Error starting 'nfs-server' service!" "${LINENO}"
fi
fi
}
################################################################################
# Check distro packages
#
# Arguments:
# packages List of packages to check separated by space
################################################################################
_check_packages()
{
packages="${1}"
for package in ${packages}; do
rpm -qa | grep -iq ^"${package}" || _exit_on_error "PACKAGE_NOT_FOUND - The '${package}' package is not installed on your system." "${LINENO}"
done
}
################################################################################
# Check requirements
################################################################################
_check_requirements()
{
# Check if package requirements are met
${ECHO} "$(date)\t Check if package requirements are met." >> "${DEV_LOG}"
if [ "${DISTRO_VERSION}" = "RHEL6" ] || [ "${DISTRO_VERSION}" = "RHEL7" ]; then
_check_packages 'libuuid uuidd'
elif [ "${DISTRO_VERSION}" = "SLES11" ]; then
_check_packages 'sapconf libuuid1 uuid-runtime'
elif [ "${DISTRO_VERSION}" = "SLES12" ]; then
_check_packages 'sapconf libuuid1 uuidd'
fi
# Ensure uuidd service is enabled and running
${ECHO} "$(date)\t Ensure uuidd service is enabled and running." >> "${DEV_LOG}"
if [ "${DISTRO_VERSION}" = "RHEL6" ] || [ "${DISTRO_VERSION}" = "SLES11" ]; then
chkconfig uuidd on >/dev/null || _exit_on_error "ERROR_UUIDD_ENABLE - Error enabling 'uuidd' service!" "${LINENO}"
service uuidd start >/dev/null || _exit_on_error "ERROR_UUIDD_START - Error starting 'uuidd' service!" "${LINENO}"
elif [ "${DISTRO_VERSION}" = "RHEL7" ] || [ "${DISTRO_VERSION}" = "SLES12" ]; then
systemctl enable uuidd >/dev/null || _exit_on_error "ERROR_UUIDD_ENABLE - Error enabling 'uuidd' service!" "${LINENO}"
systemctl start uuidd >/dev/null || _exit_on_error "ERROR_UUIDD_START - Error starting 'uuidd' service!" "${LINENO}"
fi
}
################################################################################
# Configuring NFS
################################################################################
#_configure_nfs()
#{
# local_ip=$( getent hosts "${scrHostnameFQDN}" | awk '{print $1}' )
# ${ECHO} "$(date)\t Determining local production network mask in CIDR prefix notation" >> "${DEV_LOG}"
# local_production_net=$( ip route | grep "${local_ip}" | awk '{print $1}' )
#
# ${ECHO} "$(date)\t Determining local deployment network mask in CIDR prefix notation" >> "${DEV_LOG}"
# shellcheck disable=SC2154
# local_deployment_net=$( ip route | grep "${scrDeploymentIpAddr}" | awk '{print $1}' )
#
# ${ECHO} "$(date)\t Updating /etc/exports with ${SAPMNT_MOUNTPOINT}/${scrSID} data" >> "${DEV_LOG}"
# grep -q HPE /etc/exports || _add_hpe_header_short >> /etc/exports
# echo "${SAPMNT_MOUNTPOINT}/${scrSID} ${local_production_net}(rw,no_root_squash,no_subtree_check,fsid=0)" >> /etc/exports
# if [ "${local_production_net}" != "${local_deployment_net}" ]; then
# echo "${SAPMNT_MOUNTPOINT}/${scrSID} ${local_deployment_net}(rw,no_root_squash,no_subtree_check,fsid=0)" >> /etc/exports
# fi
# export the nfs share
# exportfs -a >/dev/null || _exit_on_error "NFS_EXPORT_FAILED - Cannot export the nfs share with 'exportfs -a'." "${LINENO}"
#}
################################################################################
# Create local directories
################################################################################
_create_local_directories()
{
[ -d "${SAPINST_INSTDIR}" ] || mkdir -p "${SAPINST_INSTDIR}"
chmod 775 "${SAPINST_INSTDIR}"
chgrp sapinst "${SAPINST_INSTDIR}"
}
################################################################################
# Create random SAP master password
#
# Arguments:
# none
# Returns:
# stdout
################################################################################
_create_master_password()
{
valid_pwd='false'
while [ "${valid_pwd}" = 'false' ]; do
stdout=$( head -c 500 /dev/urandom | tr -dc "${PWCHAR}" | fold -w "${PWLENGTH}" | head -n 1 )
echo "${stdout}" | grep -E '^[a-zA-Z#$][a-zA-Z0-9_#$]{7,13}$' | grep '[a-zA-Z]' | grep -q '[0-9]' && valid_pwd='true'
done
# return the password
echo "${stdout}"
}
################################################################################
# Create Oracle autostart (init)
################################################################################
_create_oracle_autostart()
{
# shellcheck disable=SC2016
stdout=$( su - "${ORASID}" -c 'echo ${ORACLE_HOME}' )
[ -d "${stdout}" ] || _exit_on_error "NO_ORACLE_HOME - Was not able to get the ORACLE_HOME environment variable!" "${LINENO}"
if [ -f /etc/oratab ]; then
# create copy of /etc/oratab
cp -p /etc/oratab /etc/oratab.HPE_AI_BCK_"${scrSID_DB}"
# comment the entry if available
sed -i "s/^${scrSID_DB}/#&/g" /etc/oratab
fi
# create /etc/oratab autostart entry
_add_hpe_header_long >> /etc/oratab
echo "${scrSID_DB}:${stdout}:Y" >> /etc/oratab
if [ ! -f /etc/init.d/dbora ]; then
cat <<EOF > /etc/init.d/dbora
#!/bin/sh
#
# chkconfig: 345 99 10
# description: Start and stop Oracle Database Enterprise Edition
### BEGIN INIT INFO
# Provides: dbora
# Required-Start: \$network \$syslog \$remote_fs \$time
# X-UnitedLinux-Should-Start:
# Required-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Start and stop the Oracle Database Enterprise Edition
# Description: Start the Oracle Database Enterprise Edition
### END INIT INFO
ORACLE_HOME=${stdout}
ORACLE=oracle
PATH=\${PATH}:\${ORACLE_HOME}/bin
export \${PATH} \${ORACLE_HOME}
case "\${1}" in
start)
su \${ORACLE} -c "\${ORACLE_HOME}/bin/dbstart \${ORACLE_HOME}" &
;;
stop)
su \${ORACLE} -c "\${ORACLE_HOME}/bin/dbshut \${ORACLE_HOME}" &
;;
restart)
su \${ORACLE} -c "\${ORACLE_HOME}/bin/dbshut \${ORACLE_HOME}" &
sleep 5
su \${ORACLE} -c "\${ORACLE_HOME}/bin/dbstart \${ORACLE_HOME}" &
;;
*)
echo "usage: \${0} {start|stop|restart}"
exit
;;
esac
EOF
fi
# Set group and rights
chgrp dba /etc/init.d/dbora || _exit_on_error "ERROR_CHGRP_DBORA - Error adding group 'dba' to 'dbora' service!" "${LINENO}"
chmod 750 /etc/init.d/dbora || _exit_on_error "ERROR_CHMOD_DBORA - Error changing rights for 'dbora' service!" "${LINENO}"
# Ensure dbora service is created and enabled
chkconfig --add dbora >/dev/null || _exit_on_error "ERROR_ADDING_DBORA - Error adding 'dbora' service!" "${LINENO}"
chkconfig dbora on >/dev/null || _exit_on_error "ERROR_DBORA_ENABLE - Error enabling 'dbora' service!" "${LINENO}"
}
################################################################################
# Secure Storage Key Generation
################################################################################
_create_secure_storage_key()
{
if [ ! -f "${SECURE_STORAGE_FILE}" ]; then
# Generate Secure Storage Key ID
secure_storage_key_id=$( date +%Y%m%d_%H%M%S_"${scrSID}"_INSTALLER )
path_dbindep=$( find -L "${SAP_MEDIA_DIR}" -name DBINDEP -type d | grep -i "_U_${OS_SEARCH}" | head -n 1 )
file_list=$( "${path_dbindep}/SAPCAR" -tvf "${path_dbindep}/SAPEXE.SAR" | grep libicu | awk '{print $NF}' | tr '\n' ' ' )
${ECHO} "$(date)\t Extract files for Secure Storage Key Generation 'rsecssfx ${file_list}'." >> "${DEV_LOG}"
# shellcheck disable=SC2086
"${path_dbindep}/SAPCAR" -xf "${path_dbindep}/SAPEXE.SAR" -R /tmp/rsecssfx rsecssfx ${file_list} >/dev/null
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/tmp/rsecssfx"
secure_storage_key=$( /tmp/rsecssfx/rsecssfx generatekey -keyId "${secure_storage_key_id}" -getPlainValueToConsole )
# write the key-id and key to the secure storage key file
echo "key-id=${secure_storage_key_id}" > "${SECURE_STORAGE_FILE}"
echo "key=${secure_storage_key}" >> "${SECURE_STORAGE_FILE}"
# make the file only available for root
chmod 600 "${SECURE_STORAGE_FILE}"
${ECHO} "$(date)\t Secure Storage Key created and written to ${SECURE_STORAGE_FILE}." >> "${DEV_LOG}"
# remove the temporary created rsecssfx directory
rm -rf /tmp/rsecssfx >/dev/null
fi
}
################################################################################
# Create Variables
################################################################################
_create_variables()
{
# Set scrDryRun to false if empty
[ -z "${scrDryRun}" ] && scrDryRun="false"
# Set scrMultipleOS to false if empty
[ -z "${scrMultipleOS}" ] && scrMultipleOS="false"
# Set scrDatabaseVendor to DB6 if DB2
[ "${scrDatabaseVendor}" = "DB2" ] && scrDatabaseVendor="DB6"
# Convert from uppercase to lowercase and vise versa
scrDepotHost=$( _upper_lower "${scrDepotHost}" 'lower' )
scrDryRun=$( _upper_lower "${scrDryRun}" 'lower' )
scrMultipleOS=$( _upper_lower "${scrMultipleOS}" 'lower' )
scrHostFunction=$( _upper_lower "${scrHostFunction}" 'lower' )
scrDatabaseVendor=$( _upper_lower "${scrDatabaseVendor}" 'upper' )
scrGlobalHost=$( _upper_lower "${scrGlobalHost}" 'lower' )
# Sanity checks
_sanity_check 'scrDepotHost'
_sanity_check 'scrDepotName'
#_sanity_check 'scrDepotSapDirectory'
_sanity_check 'scrDryRun'
_sanity_check 'scrMultipleOS'
_sanity_check 'scrHostFunction'
_sanity_check 'scrDatabaseVendor'
# Path to SAP media directory
# shellcheck disable=SC2154
SAP_MEDIA_DIR="${SWDEPOT_MOUNTPOINT}"
# shellcheck disable=SC2154
{
${ECHO} "$(date)\t Assigned variables:";
${ECHO} "$(date)\t scrDepotHost='${scrDepotHost}'";
${ECHO} "$(date)\t scrDepotName='${scrDepotName}'";
${ECHO} "$(date)\t scrDepotSapDirectory='${scrDepotSapDirectory}'";
${ECHO} "$(date)\t scrCifsUsername='${scrCifsUsername}'";
# ${ECHO} "$(date)\t scrCifsPassword='${scrCifsPassword}'";
${ECHO} "$(date)\t scrDryRun='${scrDryRun}'";
${ECHO} "$(date)\t scrMultipleOS='${scrMultipleOS}'";
${ECHO} "$(date)\t scrHostFunction='${scrHostFunction}'";
${ECHO} "$(date)\t scrDatabaseVendor='${scrDatabaseVendor}'";
${ECHO} "$(date)\t scrGlobalHost='${scrGlobalHost}'";
} >> "${DEV_LOG}"
if [ "${scrDatabaseVendor}" = "HDB" ] && { [ "${scrHostFunction}" = "db" ] || [ "${scrHostFunction}" = "standard" ]; }; then
[ -n "${scrIpAddr}" ] && INSTALL_SAP_OR_HDB="sap" || INSTALL_SAP_OR_HDB="hdb"
[ "${scrIpAddr_HDB}" = "${scrIpAddr}" ] && INSTALL_SAP_OR_HDB="both"
else
INSTALL_SAP_OR_HDB="sap"
fi
if [ "${scrHostFunction}" = "db" ] && [ "${scrDatabaseVendor}" = "HDB" ]; then
_create_variables_hana_db
# for distributed DB installation
[ "${INSTALL_SAP_OR_HDB}" = "both" ] && _create_variables_sap_systems
elif [ "${scrHostFunction}" != "db" ] && [ "${scrDatabaseVendor}" = "HDB" ]; then
_create_variables_sap_systems
_create_variables_hana_db
else
_create_variables_sap_systems
fi
# Checks for SAP and HDB on same host
if [ "${INSTALL_SAP_OR_HDB}" = "both" ]; then
# shellcheck disable=SC2154
[ "${scrSID}" = "${scrSID_HDB}" ] && _exit_on_error "SANITY_CHECK - Error during sanity check of SAP SID '${scrSID}' and HDB SID '${scrSID_HDB}'. SIDs may not be the same." "${LINENO}"
# shellcheck disable=SC2154
[ "${scrInstanceNumber}" = "${scrInstanceNumber_HDB}" ] && _exit_on_error "SANITY_CHECK - Error during sanity check of SAP InstanceNr '${scrInstanceNumber}' and HDB InstanceNumber '${scrInstanceNumber_HDB}'. SAP Instance Numbers may not be the same." "${LINENO}"
fi
}
################################################################################
# Create variables for HANA DB
################################################################################
_create_variables_hana_db()
{
HDB_CONF_TEMPLATE="${SAP_MEDIA_DIR}/hdblcm_custom.conf"
HDB_CONF="${SCRIPTDIR}/hdblcm.conf"
# Convert from uppercase to lowercase and vise versa
scrHostnameFQDN_HDB=$( _upper_lower "${scrHostnameFQDN_HDB}" 'lower' )
scrSID_HDB=$( _upper_lower "${scrSID_HDB}" 'upper' )
sid_hdb_lc=$( _upper_lower "${scrSID_HDB}" 'lower' )
# Sanity checks
_sanity_check 'scrHostnameFQDN_HDB'
_sanity_check 'scrIpAddr_HDB'
_sanity_check 'scrDeploymentIpAddr_HDB'
_sanity_check 'scrSID_HDB'
_sanity_check 'scrInstanceNumber_HDB'
_sanity_check 'scrMasterPW_HDB'
# Check FQDN for domainname
echo "${scrHostnameFQDN_HDB}" | grep -q '\.'
# shellcheck disable=SC2154
[ "$?" -ne 0 ] && scrHostnameFQDN_HDB=$( _get_hostname "${scrIpAddr_HDB}" )
# HOSTNAME_HDB and domainname_hdb out of scrHostnameFQDN_HDB
HOSTNAME_HDB=$( echo "${scrHostnameFQDN_HDB}" | cut -d. -f1 )
_sanity_check 'HOSTNAME_HDB'
# Create the HDB <sid>adm user
SIDADM_HDB="${sid_hdb_lc}adm"
# shellcheck disable=SC2154
{
${ECHO} "$(date)\t scrHostnameFQDN_HDB='${scrHostnameFQDN_HDB}'";
${ECHO} "$(date)\t scrIpAddr_HDB='${scrIpAddr_HDB}'";
${ECHO} "$(date)\t scrDeploymentIpAddr_HDB='${scrDeploymentIpAddr_HDB}'";
${ECHO} "$(date)\t scrSID_HDB='${scrSID_HDB}'";
${ECHO} "$(date)\t scrInstanceNumber_HDB='${scrInstanceNumber_HDB}'";
${ECHO} "$(date)\t SIDADM_HDB='${SIDADM_HDB}'";
} >> "${DEV_LOG}"
${ECHO} "$(date)\t HDB_MASSIMPORT=YES">> "${DEV_LOG}"
export HDB_MASSIMPORT=YES
}
################################################################################
# Create variables for SAP systems
################################################################################
_create_variables_sap_systems()
{
INIFILE_PARAMS_TEMPLATE="${SAP_MEDIA_DIR}/inifile_custom.params"
INIFILE_PARAMS="${SAPINST_INSTDIR}/inifile.params"
# Define scrSID_DB if empty
[ -z "${scrSID_DB}" ] && scrSID_DB="${scrSID}"
# Backward compatibility for scrSapFlavour which changed to scrSapStack
# shellcheck disable=SC2154
if [ -z "${scrSapStack}" ] && [ -n "${scrSapFlavour}" ]; then
scrSapStack="${scrSapFlavour}"
fi
# Convert from uppercase to lowercase and vise versa
scrHostnameFQDN=$( _upper_lower "${scrHostnameFQDN}" 'lower' )
scrSID=$( _upper_lower "${scrSID}" 'upper' )
scrSID_DB=$( _upper_lower "${scrSID_DB}" 'upper' )
scrSapApplication=$( _upper_lower "${scrSapApplication}" 'upper' )
scrSapVersion=$( _upper_lower "${scrSapVersion}" 'upper' )
scrSapStack=$( _upper_lower "${scrSapStack}" 'upper' )
sid_lc=$( _upper_lower "${scrSID}" 'lower' )
sid_db_lc=$( _upper_lower "${scrSID_DB}" 'lower' )
# Sanity checks
_sanity_check 'scrGlobalHost'
_sanity_check 'scrHostnameFQDN'
_sanity_check 'scrIpAddr'
_sanity_check 'scrDeploymentIpAddr'
_sanity_check 'scrSID'
_sanity_check 'scrSID_DB'
_sanity_check 'scrInstanceNumber'
_sanity_check 'scrSapStack'
_sanity_check 'scrMasterPW'
# Check FQDN for domainname
echo "${scrHostnameFQDN}" | grep -q '\.'
# shellcheck disable=SC2154
[ "$?" -ne 0 ] && scrHostnameFQDN=$( _get_hostname "${scrIpAddr}" )
# HOSTNAME and DOMAINNAME out of scrHostnameFQDN
HOSTNAME=$(echo "${scrHostnameFQDN}" | cut -d. -f1)
DOMAINNAME=$(echo "${scrHostnameFQDN}" | cut -s -d. -f2-)
_sanity_check 'HOSTNAME'
# Set scrSapStack with the right values
[ "${scrSapStack}" = "JAVA" ] && scrSapStack="Java"
[ "${scrSapStack}" = "DOUBLESTACK" ] && scrSapStack="Doublestack"
# Set scrHostFunction with the right values for ascs and scs
if [ "$scrHostFunction" = "ascs" ] || [ "$scrHostFunction" = "scs" ]; then
[ "$scrSapStack" = "ABAP" ] && scrHostFunction="ascs" || scrHostFunction="scs"
fi
# Create the various sap users
SIDADM="${sid_lc}adm"
SQDSID="sqd${sid_db_lc}"
DB2SID="db2${sid_db_lc}"
ORASID="ora${sid_db_lc}"
SYBSID="syb${sid_db_lc}"
# Check for MCOD system
grep -q "${ORASID}" /etc/passwd && ( su - "${ORASID}" -c '[ -d ${ORACLE_HOME} ]' && DB_EXISTS=true )
# shellcheck disable=SC2154
{
${ECHO} "$(date)\t scrHostnameFQDN='${scrHostnameFQDN}'";
${ECHO} "$(date)\t scrIpAddr='${scrIpAddr}'";
${ECHO} "$(date)\t scrDeploymentIpAddr='${scrDeploymentIpAddr}'";
${ECHO} "$(date)\t scrSID='${scrSID}'";
${ECHO} "$(date)\t scrSID_DB='${scrSID_DB}'";
${ECHO} "$(date)\t scrInstanceNumber='${scrInstanceNumber}'";
${ECHO} "$(date)\t scrSapApplication='${scrSapApplication}'";
${ECHO} "$(date)\t scrSapVersion='${scrSapVersion}'";
${ECHO} "$(date)\t scrSapStack='${scrSapStack}'";
${ECHO} "$(date)\t HOSTNAME='${HOSTNAME}'";
${ECHO} "$(date)\t DOMAINNAME='${DOMAINNAME}'";
${ECHO} "$(date)\t SIDADM='${SIDADM}'";
${ECHO} "$(date)\t SQDSID='${SQDSID}'";
${ECHO} "$(date)\t DB2SID='${DB2SID}'";
${ECHO} "$(date)\t ORASID='${ORASID}'";
${ECHO} "$(date)\t SYBSID='${SYBSID}'";
} >> "${DEV_LOG}"
}
################################################################################
# Determine SAP Product ID
################################################################################
_determine_sap_product_id()
{
${ECHO} "$(date)\t Starting SAP installation through SWPM" >> "${DEV_LOG}"
product_catalog="${SWPM_DIR}/product.catalog"
[ -f "${product_catalog}" ] || _exit_on_error "NO_PRODUCT_CATALOG - No product.catalog file found in '${SWPM_DIR}'." "${LINENO}"
case "${scrHostFunction}" in
# Standard system on a single host
standard)
front_pattern="NW_${scrSapStack}_OneHost"
;;
# Central Services instance for ABAP (ASCS instance)
ascs)
front_pattern="NW_${scrSapStack}_ASCS"
;;
# Central Services instance for Java (SCS instance)
scs)
front_pattern="NW_${scrSapStack}_SCS"
;;
# Database instance (DB)
db)
front_pattern="NW_${scrSapStack}_DB"
;;
# Primary Application Server instance (PAS instance)
pas)
front_pattern="NW_${scrSapStack}_CI"
;;
# Additional Application Server instance (AAS instance)
aas)
front_pattern="NW_DI"
;;
*)
_exit_on_error "NO_HOSTFUNCTION - '${scrHostFunction}' is no valid HostFunction." "${LINENO}"
;;
esac
# SAP version and application
# check for NetWeaver
# shellcheck disable=SC2154
echo "${scrSapVersion}" | grep -q "^NW" && back_pattern="${scrSapVersion}\.${scrDatabaseVendor}\.${scrSapApplication}"
# check for Business Suite
echo "${scrSapVersion}" | grep -q "^BS2" && back_pattern="${scrSapVersion}\.${scrSapApplication}\.${scrDatabaseVendor}\.P.*"
# check for Business Suite on HANA
echo "${scrSapVersion}" | grep -q "^BSON" && back_pattern="${scrSapVersion}\.${scrSapApplication}\.${scrDatabaseVendor}\.P.*"
# check for SolMan
echo "${scrSapVersion}" | grep -q "^SOLMAN" && back_pattern="${scrSapVersion}\.${scrDatabaseVendor}\.P.*"
# check for S4HANA
echo "${scrSapVersion}" | grep -q "^S4HANA"
if [ "$?" = 0 ]; then
if [ "${scrSapStack}" = "ABAP" ]; then
back_pattern="${scrSapVersion}\.${scrSapApplication}\.${scrDatabaseVendor}\.ABAP"
elif [ "${scrSapStack}" = "Java" ]; then
back_pattern="${scrSapVersion}\.${scrSapApplication}\.${scrDatabaseVendor}\.PD"
fi
fi
[ -z "${back_pattern}" ] && _exit_on_error "SAPVERSION_NOT_SUPPORTED - '${scrSapVersion}' is not supported (yet)." "${LINENO}"
pattern="${front_pattern}:${back_pattern}"
# Try to determine Product-ID
${ECHO} "$(date)\t Determining Product-ID by processing Product Catalog '${product_catalog}'" >> "${DEV_LOG}"
${ECHO} "$(date)\t Pattern: '${pattern}'" >> "${DEV_LOG}"
SAP_PRODUCT_ID=$( grep "id=\"${pattern}" "${product_catalog}" | grep -Eo 'id=\"[A-z0-9.:]*\"' | sed 's/id=\"\(.*\)\"/\1/g' | sort | uniq )
# ToDo: If more than one Product-ID then _exit_on_error ???
count=$( echo "${SAP_PRODUCT_ID}" | wc -l )
if [ "${count}" -gt 1 ]; then
${ECHO} "Found more than 1 SAP Product ID! Taking first one!" >> "${INSTALLATION_LOG}"
${ECHO} "$(date)\t Found more than one product-ID! Taking first one" >> "${DEV_LOG}"
for prodid in ${SAP_PRODUCT_ID}; do
${ECHO} "$(date)\t ${prodid}" >> "${DEV_LOG}"
done
SAP_PRODUCT_ID=$( { echo "${SAP_PRODUCT_ID}" | while read -r i; do echo "$i"; break; done } )
fi
[ -z "${SAP_PRODUCT_ID}" ] && _exit_on_error "NO_SAP_PRODUCT_ID - Could not find SAP Product ID for '${scrSapVersion}' - '${scrSapApplication}'" "${LINENO}"
${ECHO} "$(date)\t SAP Product-ID: '${SAP_PRODUCT_ID}'" >> "${DEV_LOG}"
}
################################################################################
# Test with DryRun
################################################################################
_dry_run()
{
if [ "${scrDryRun}" = "true" ] || [ "${scrDryRun}" = "host_preparation" ]; then
${ECHO} "$(date)\t Master Password created >DRY-RUN<" >> "${INSTALLATION_LOG}"
${ECHO} "$(date)\t Dry Run set to 'host_preparation', exiting!" >> "${INSTALLATION_LOG}"
${ECHO} "$(date)\t Dry Run set to 'host_preparation', exiting!" >> "${DEV_LOG}"
exit 0
fi
}
################################################################################
# Error handling
#
# Expected Input
# error_msg: Error message
# error_line: Error line number
################################################################################
_exit_on_error()
{
error_msg="${1}"
error_line="${2}"
date=$( date +"${DATE_FORMAT}" )
error_msg="ERROR: ${error_msg}"
# Writing error message to error log
printf '%s\n' "${error_msg}" > "${ERROR_LOG}"
[ -n "${error_line}" ] && error_msg="ERROR Line ${error_line}: ${error_msg}"
# Writing error message to installation logs
printf '%s %s\n' "${date}" "${error_msg}" >> "${DEV_LOG}"
printf '%s %s\n' "${date}" "${error_msg}" >> "${INSTALLATION_LOG}"
# Writing error message to stdout
printf '%s\n' "${error_msg}" >&2
exit 1
}
################################################################################
# Get the hostname from DNS server or /etc/hosts
#
# Arguments:
# ip_address
# Returns:
# stdout
################################################################################
_get_hostname()
{
ip_address="${1}"
grep -q '^nameserver' /etc/resolv.conf
if [ "$?" -eq 0 ]; then
stdout=$( host "${ip_address}" | awk '{print $NF}' | sed 's/\.$//g' | tr '[:upper:]' '[:lower:]' )
else
stdout=$( getent hosts "${ip_address}" | awk '{print $2}' | tr '[:upper:]' '[:lower:]' )
fi
count="$( echo "${stdout}" | wc -w )"
if [ "${count}" -eq 1 ]; then
# there is exactly one hostname for the IP address
echo "${stdout}"
elif [ "${count}" -gt 1 ]; then
# there is more than one hostname for the IP address
_exit_on_error "GET_HOSTNAME_FAILED - There are multiple hostnames for the IP address: '${ip_address}'." "${LINENO}"
else
_exit_on_error "GET_HOSTNAME_FAILED - There is something wrong !!!" "${LINENO}"
fi
}
################################################################################
# Initialize Script
################################################################################
_initialize()
{
# Determine the script directory
SCRIPTDIR="/tmp/sap_script"
# location of local input file with input parameters
LOCAL_INPUT_FILE="${SCRIPTDIR}/local_input.ini"
# source the local input file
_source_local_input_file
# Log files
INSTALLATION_LOG="${SCRIPTDIR}/sap_installation.log"
DEV_LOG="${SCRIPTDIR}/sap_dev_installation.log"
HDB_LOG="${SCRIPTDIR}/sap_hdb_installation.log"
ERROR_LOG="${SCRIPTDIR}/sap_error.log"
# ToDo: Description
SWDEPOT_MOUNTPOINT="/usr/sap/scratch/media/ZTA/Netweaver_742"
#SWDEPOT_MOUNTPOINT="/usr/sap/scratch/media/ZTA"
#SWDEPOT_MOUNTPOINT="/tmp/SAPmedia"
SAPMNT_MOUNTPOINT="/sapmnt"
SAPINST_INSTDIR="/tmp/sapinst_instdir"
SECURE_STORAGE_FILE="${SCRIPTDIR}/secure_storage_key_${scrSID}.txt"
MASTER_PASSWORD_FILE="${SCRIPTDIR}/master_password.txt"
# Password policy
#
# The SAP master password must meet the following requirements:
# - It must be 8 to 14 characters long
# - It must contain at least one letter (a-z, A-Z)
# - It must contain at least one digit (0-9)
# - It can contain the following characters: _, #, $, a-z, A-Z, 0-9
# - It must not contain \ (backslash) and " (double quote)
# - It must not begin with a digit nor an underscore
#
# The length of the random password
PWLENGTH="10"
# Characters that should be used for the random password
PWCHAR="23456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"
# Date format for logging
DATE_FORMAT="%b %d %T"
# Determine Host-OS
OS=$( uname -s )
if [ "${OS}" = "Linux" ]; then
ECHO="echo -e"
OS_SEARCH="Linux"
if [ -f /etc/redhat-release ]; then
DISTRO="RHEL"
DISTRO_VERSION="${DISTRO}"$( awk '/release/ {print $7}' /etc/redhat-release | sed 's/ //g' | cut -d. -f1 )
DISTRO_PATCHLEVEL=$( awk '/release/ {print $7}' /etc/redhat-release | sed 's/ //g' | cut -d. -f2 )
elif [ -f /etc/SuSE-release ]; then
DISTRO="SLES"
DISTRO_VERSION="${DISTRO}"$( awk '/VERSION/ {print $3}' /etc/SuSE-release | sed 's/ //g' )
DISTRO_PATCHLEVEL=$( awk '/PATCHLEVEL/ {print $3}' /etc/SuSE-release | sed 's/ //g' )
fi
else
_exit_on_error "OS_NOT_SUPPORTED - Local OS '${OS}' is not supported with this version!" "${LINENO}"
fi
# In case of an application server installation the log files could already exist.
[ -f "${INSTALLATION_LOG}" ] && mv "${INSTALLATION_LOG}" "${INSTALLATION_LOG}.$$"
[ -f "${DEV_LOG}" ] && mv "${DEV_LOG}" "${DEV_LOG}.$$"
[ -f "${ERROR_LOG}" ] && mv "${ERROR_LOG}" "${ERROR_LOG}.$$"
[ -d "${SAPINST_INSTDIR}" ] && mv "${SAPINST_INSTDIR}" "${SAPINST_INSTDIR}.$$"
${ECHO} "$(date)\t SAP Installation started" >> "${INSTALLATION_LOG}"
}
################################################################################
# SAP HANA database installation with hdblcm
################################################################################
_install_hdblcm()
{
${ECHO} "$(date)\t Installing SAP HANA Database" >> "${INSTALLATION_LOG}"
#######################################
# Locate hdblcm for HANA DB
#######################################
${ECHO} "$(date)\t HDBLCM ==> find -L ${SAP_MEDIA_DIR} -name hdblcm | grep LCM | grep -i \"${OS_SEARCH}\" " >> "${DEV_LOG}" 2>&1
HDBLCM=$( find -L "${SAP_MEDIA_DIR}" -name hdblcm -type f | grep -i "HDB_LCM_${OS_SEARCH}" )
[ -z "${HDBLCM}" ] && _exit_on_error "NO_HDBLCM_FOUND - There is no hdblcm present in '${SAP_MEDIA_DIR}'." "${LINENO}"
count=$( echo "${HDBLCM}" | wc -l )
[ "${count}" -gt 1 ] && _exit_on_error "TOO_MANY_HDBLCM_FOUND - There is more than one hdblcm present in '${SAP_MEDIA_DIR}'." "${LINENO}"
${ECHO} "$(date)\t HDBLCM ==>>${HDBLCM}<==" >> "${INSTALLATION_LOG}" 2>&1
_prepare_hdb_conf
#######################################
# Install HANA DB
#######################################
${ECHO} "$(date)\t Installing HANA DB" >> "${INSTALLATION_LOG}"
${ECHO} "$(date)\t Installing HANA DB with configuration file '${HDB_CONF}'" >> "${DEV_LOG}"
${HDBLCM} --batch --configfile="${HDB_CONF}" >> "${HDB_LOG}" 2>&1 || _exit_on_error "HDBLCM_FAILED - HANA DB installation failed. Please check '${HDB_LOG}'." "${LINENO}"
${ECHO} "$(date)\t HDB Installation finished successfully." >> "${INSTALLATION_LOG}"
}
################################################################################
# SAP installation with sapinst (SWPM) - NetWeaver, BusinessSuite, S/4HANA ...
################################################################################
install_sapinst()
{
${ECHO} "$(date)\t Installing SAP Business Suite or S/4HANA" >> "${INSTALLATION_LOG}"
#######################################
# Check if SAP is already installed
#######################################
#if [ "${scrHostFunction}" = "aas" ]; then
#${ECHO} "$(date)\t Check if SAP already installed" >> "${INSTALLATION_LOG}"
#if [ -f /home/"${SIDADM}"/.sapenv_"${HOSTNAME}".csh ]; then
# ${ECHO} "$(date)\t SAP already installed, nothing to do here" >> "${INSTALLATION_LOG}"
# return
#fi
#fi
#######################################
# Add sapinst group
#######################################
${ECHO} "$(date)\t Adding group 'sapinst' to /etc/group file." >> "${INSTALLATION_LOG}"
_add_sapinst_group
#######################################
# Creating directories and copying files
#######################################
${ECHO} "$(date)\t Creating local directories" >> "${INSTALLATION_LOG}"
_create_local_directories
#######################################
# Making OS specific settings
#######################################
${ECHO} "$(date)\t Creating Linux specific OS settings" >> "${INSTALLATION_LOG}"
_linux_config
#######################################
# Attach the global host
#######################################
#if [ "${scrHostFunction}" = "pas" ] || [ "$scrHostFunction" = "aas" ] || { [ "${scrHostFunction}" = "db" ] && [ "${scrDatabaseVendor}" != "HDB" ]; }; then
# ${ECHO} "$(date)\t Attaching shares from global host" >> "${INSTALLATION_LOG}"
# _attach_global_host
fi
#######################################
# Prepare SAP infrastructure
#######################################
${ECHO} "$(date)\t Preparing SAP Media remotely and locally" >> "${INSTALLATION_LOG}"
_prepare_sap_media
# Determine SAP Product ID
_determine_sap_product_id
${ECHO} "$(date)\t Installing '${scrSapVersion}' '${scrSapApplication}' on '${scrDatabaseVendor}' as '${scrHostFunction}' system with SAP Product-ID '${SAP_PRODUCT_ID}'." >> "${INSTALLATION_LOG}"
#######################################
# Secure Storage Key Generation
#######################################
if [ "${scrHostFunction}" = "standard" ] || [ "${scrHostFunction}" = "pas" ] ; then
${ECHO} "$(date)\t Create Secure Storage Key file." >> "${DEV_LOG}"
_create_secure_storage_key
fi
###############################################
# DB-specific actions
###############################################
if [ "${scrHostFunction}" = "standard" ] || [ "${scrHostFunction}" = "db" ] && [ "${scrDatabaseVendor}" = "DB6" ]; then
_reserve_db2_ports