Rewrote license activation to use a lock to prevent race-conditions.

This commit is contained in:
2025-12-22 00:42:23 -08:00
parent 71b6b94a3a
commit e427bfd6b9
7 changed files with 98 additions and 20 deletions

View File

@@ -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"