From 635ead628308778230bcd320dc7b8f45b4f4e378 Mon Sep 17 00:00:00 2001 From: Zack T Date: Wed, 10 Jan 2018 20:15:55 -0700 Subject: [PATCH] v1.1 = Updated to new licensing format + Updated to new licensing format --- Software/license_Minitab.sh | 39 ++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/Software/license_Minitab.sh b/Software/license_Minitab.sh index db1d8a2..41a3b94 100644 --- a/Software/license_Minitab.sh +++ b/Software/license_Minitab.sh @@ -1,21 +1,38 @@ -#!/bin/sh +#!/bin/bash -########################################################### +################################################################################################### # Script Name: license_Minitab.sh # By: Zack Thompson / Created: 3/6/2017 -# Version: 1.0 / Updated: 3/6/2017 / By: ZT +# Version: 1.1 / Updated: 1/10/2018 / By: ZT # -# Description: This script is used activate Minitab with a Network License Server. +# Description: This script applies the license for Minitab. # -########################################################### +################################################################################################### -# All that is required is to write in the plist file the name of the license server. -Echo "Adding network server address for activation..." -sudo defaults write /Library/Application\ Support/Minitab/Minitab\ Express/mtblic.plist "License File" @server.company.com +/usr/bin/logger -s "***** License Minitab process: START *****" -# Set permissions on the file for everyone to be able to read. -sudo chmod 644 /Library/Application\ Support/Minitab/Minitab\ Express/mtblic.plist +################################################## +# Define Variables -Echo "Configuration Complete!" +licenseFile="/Library/Application Support/Minitab/Minitab Express/mtblic.plist" + +################################################## +# Bits staged, license software... + +/usr/bin/logger -s "Configuring the License Manager Server..." +/usr/bin/defaults write "${licenseFile}" "License File" @license.server.com + +if [[ -e "${licenseFile}" ]]; then + # Set permissions on the file for everyone to be able to read. + /usr/bin/logger -s "Applying permissions to license file..." + /bin/chmod 644 "${licenseFile}" +else + /usr/bin/logger -s "ERROR: Failed to create the license file!" + /usr/bin/logger -s "***** License Minitab process: FAILED *****" + exit 1 +fi + +/usr/bin/logger -s "Minitab has been activated!" +/usr/bin/logger -s "***** License Minitab process: COMPLETE *****" exit 0