diff --git a/Software/Matlab/license_Matlab.sh b/Software/Matlab/license_Matlab.sh new file mode 100644 index 0000000..c095765 --- /dev/null +++ b/Software/Matlab/license_Matlab.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +################################################################################################### +# Script Name: license_Matlab.sh +# By: Zack Thompson / Created: 1/10/2018 +# Version: 1.0 / Updated: 1/10/2018 / By: ZT +# +# Description: This script applies the license for Matlab applications. +# +################################################################################################### + +/usr/bin/logger -s "***** License Matlab process: START *****" + +################################################## +# Define Variables + +# If the machine has multiple Matlab Applications, loop through them... +/usr/bin/find /Applications -name "Matlab*.app" -maxdepth 1 -type d | while IFS="\n" read -r appPath; do + + # Get the Matlab version + appVersion=$(/usr/bin/defaults read "${appPath}/Contents/Info.plist" CFBundleShortVersionString) + /usr/bin/logger -s "Apply License for Matlab Version: ${appVersion}" + + # Build the license file location + licenseFile="${appPath}/licenses/network.lic" + + ################################################## + # Create the license file. + + /usr/bin/logger -s "Creating license file..." + + /bin/cat > "${licenseFile}" <