Rewrote license activation to use a lock to prevent race-conditions.
This commit is contained in:
@@ -18,6 +18,7 @@ check_path USERNAME
|
||||
check_path PASSWORD
|
||||
|
||||
if [[ -z "$SERIAL" || -z "$USERNAME" || -z "$PASSWORD" ]]; then
|
||||
echo "Warning: License activation skipped - missing credentials"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -25,7 +26,16 @@ fi
|
||||
if [[ "$SERIAL" == "personal" ]]; then
|
||||
echo "Obtaining personal license for Unity..."
|
||||
UnityBuilder activate -i /usr/bin/unity-editor -u $USERNAME -p $PASSWORD
|
||||
ACTIVATION_RESULT=$?
|
||||
else
|
||||
echo "Activating Unity License with serial number."
|
||||
unity-editor $DEFAULT_ARGS -serial $SERIAL -username $USERNAME -password $PASSWORD
|
||||
fi
|
||||
ACTIVATION_RESULT=$?
|
||||
fi
|
||||
|
||||
if [[ $ACTIVATION_RESULT -ne 0 ]]; then
|
||||
echo "ERROR: Unity license activation failed with exit code $ACTIVATION_RESULT"
|
||||
exit $ACTIVATION_RESULT
|
||||
fi
|
||||
|
||||
echo "Unity license activated successfully"
|
||||
Reference in New Issue
Block a user