mirror of
https://github.com/MLBZ521/MacAdmin.git
synced 2026-03-20 16:00:25 +00:00
v1.1 = Improved the script logic
+ Improved the script logic
This commit is contained in:
@@ -3,15 +3,41 @@
|
||||
###################################################################################################
|
||||
# Script Name: license_Fetch.sh
|
||||
# By: Zack Thompson / Created: 6/28/2017
|
||||
# Version: 1.0 / Updated: 6/28/2017 / By: ZT
|
||||
# Version: 1.1 / Updated: 2/16/2018 / By: ZT
|
||||
#
|
||||
# Description: This script will license Fetch with ASU's License.
|
||||
#
|
||||
###################################################################################################
|
||||
|
||||
/bin/echo "***** license Fetch Process: START *****"
|
||||
|
||||
##################################################
|
||||
# Define Variables
|
||||
FetchApp="/Applications/Fetch.app"
|
||||
plist="/Library/Preferences/com.fetchsoftworks.Fetch.License"
|
||||
registrantName="Customer Name"
|
||||
serialNumber="FETCH12345-6789-0123-4567-8910-1112"
|
||||
|
||||
/usr/bin/defaults write $plist SerialNumber "$serialNumber"
|
||||
/usr/bin/defaults write $plist RegistrantName "$registrantName"
|
||||
##################################################
|
||||
# Bits staged...
|
||||
|
||||
if [[ ! -x $FetchApp ]]; then
|
||||
/bin/echo "Error: Fetch is not properly installed."
|
||||
/bin/echo "***** license Fetch Process: FAILED *****"
|
||||
exit 1
|
||||
else
|
||||
/bin/echo "Applying the Fetch license..."
|
||||
/usr/bin/defaults write $plist SerialNumber "$serialNumber"
|
||||
/usr/bin/defaults write $plist RegistrantName "$registrantName"
|
||||
|
||||
if [[ -e $plist ]]; then
|
||||
/bin/echo "Fetch has been licensed!"
|
||||
/bin/echo "***** license Fetch Process: COMPLETE *****"
|
||||
else
|
||||
/bin/echo "Error: License does not exist."
|
||||
/bin/echo "***** license Fetch Process: FAILED *****"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user