cancel
Showing results for 
Search instead for 
Did you mean: 
Create a Post
Highlighted

Add sources inside bash scripts

To my understanding, the call for Check Point shell script (source /etc/profile.d/CP.sh) needs to be added at the very start of the script right after the sha-bang as per link below:

https://sc1.checkpoint.com/documents/R80.20_GA/WebAdminGuides/EN/CP_R80.20_CLI_ReferenceGuide/html_f...

I couldn't help but notice however that in several other scripts like the health check script that several sources are specified:

 

#====================================================================================================

#  Check Point Sources

#====================================================================================================

source /etc/profile.d/CP.sh 2> /dev/null

source /etc/profile.d/vsenv.sh 2> /dev/null

source $MDSDIR/scripts/MDSprofile.sh 2> /dev/null

source $MDS_SYSTEM/shared/sh_utilities.sh 2> /dev/null

source $MDS_SYSTEM/shared/mds_environment_utils.sh 2> /dev/null

 

As such, could somebody please explain to me if there are other calls we could use in our scripts apart from source /etc/profile.d/CP.sh?

Many thanks in advance.

0 Kudos
1 Reply
Admin
Admin

Re: Add sources inside bash scripts

The other sources appear to include items relevant for MDS and VSX.
These environment variables are not relevant for every script.
That said, if you are doing something on a per domain or per VS in your script, including them is probably a good idea.
0 Kudos