Walls along terrain-edges following the terrain height!?

Hey guys,

id like create walls around a existing terrain per script.
This wall should follow the terrain height besides.

See the attached image for example.

Any ideas?

thanks

3360132--263135--terrain2.JPG

Have you tried anything so far?

Is this helpful at all? Unity - Scripting API: Terrain.SampleHeight