Illustrator

My goal is, to fill the letter “S” with a B/W linear gradient. But I want the gradient to fill the “S” in the shape of an “S”, not top to bottom.

How can I do that? Is there smt like typing on a path, but with a gradient?