| 
									
										
										
										
											2022-01-26 06:36:12 +00:00
										 |  |  | #!/usr/bin/env bash
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | echo "Requesting activation" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-26 09:14:47 +00:00
										 |  |  | # Make directory for license | 
					
						
							| 
									
										
										
										
											2022-01-26 09:27:49 +00:00
										 |  |  | sudo mkdir /Library/Application\ Support/Unity | 
					
						
							| 
									
										
										
										
											2022-01-26 09:43:51 +00:00
										 |  |  | sudo chmod -R 777 /Library/Application\ Support/Unity | 
					
						
							| 
									
										
										
										
											2022-01-26 09:14:47 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-26 06:36:12 +00:00
										 |  |  | # Activate license | 
					
						
							|  |  |  | /Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity \
 | 
					
						
							|  |  |  |   -logFile /dev/stdout \
 | 
					
						
							| 
									
										
										
										
											2022-01-26 08:59:16 +00:00
										 |  |  |   -batchmode \
 | 
					
						
							|  |  |  |   -nographics \
 | 
					
						
							| 
									
										
										
										
											2022-01-26 06:36:12 +00:00
										 |  |  |   -quit \
 | 
					
						
							|  |  |  |   -serial "$UNITY_SERIAL" \
 | 
					
						
							|  |  |  |   -username "$UNITY_EMAIL" \
 | 
					
						
							|  |  |  |   -password "$UNITY_PASSWORD" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Store the exit code from the verify command | 
					
						
							|  |  |  | UNITY_EXIT_CODE=$? | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # Display information about the result | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | if [ $UNITY_EXIT_CODE -eq 0 ]; then | 
					
						
							|  |  |  |   # Activation was a success | 
					
						
							|  |  |  |   echo "Activation complete." | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  |   # Activation failed so exit with the code from the license verification step | 
					
						
							|  |  |  |   echo "Unclassified error occured while trying to activate license." | 
					
						
							|  |  |  |   echo "Exit code was: $UNITY_EXIT_CODE" | 
					
						
							|  |  |  |   exit $UNITY_EXIT_CODE | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Return to previous working directory | 
					
						
							|  |  |  | popd |