v1.1 = Added check for if directory exists

+ Added a check to see if the directory exists, if not create directory (the license directory doesn't exist until the app is launched)
This commit is contained in:
Zack T
2018-01-29 21:47:45 -07:00
parent f741789e6e
commit 04c15d42a9

10
Software/Mathematica/license_Mathematica.sh Normal file → Executable file
View File

@@ -3,7 +3,7 @@
###################################################################################################
# Script Name: license_Mathematica.sh
# By: Zack Thompson / Created: 1/10/2018
# Version: 1.0 / Updated: 1/10/2018 / By: ZT
# Version: 1.1 / Updated: 1/29/2018 / By: ZT
#
# Description: This script applies the license for Mathematica applications.
#
@@ -14,11 +14,17 @@
##################################################
# Define Variables
licenseFile="/Library/Mathematica/Licensing/mathpass"
licenseDirectory="/Library/Mathematica/Licensing"
licenseFile="${licenseDirectory}/mathpass"
##################################################
# Create the license file.
if [[ ! -d "${licenseDirectory}" ]]; then
/usr/bin/logger -s "Creating License Directory..."
/bin/mkdir -p "${licenseDirectory}"
fi
/usr/bin/logger -s "Creating license file..."
/bin/cat > "${licenseFile}" <<licenseContents