Purana Jyotisha Sangraha · by Vyasa
Chapter 12 · Prabhasa and the Planet Lingas
स्कन्दपुराणम् : प्रभासक्षेत्रे ग्रहलिङ्गानि
मरणं वेति संध्याय शरणं वा महेश्वरम् ।वरं शापाभिघातार्थं मृत्युं वा शंकरान्मम ॥ २७ ॥
From the Skanda Purana, print Prabhasa Khanda (Prabhasa-kshetra-mahatmya) ch 22, verse 27.
The Moon thought: 'Either death, or Maheshvara as my shelter. From Shankara I want freedom from the curse, or else death.'
Simple meaning: The Moon decided to seek Shiva's shelter, wanting freedom from the curse or an end.
इति सोमो मतिं कृत्वा तपसाऽऽराधयञ्छिवम् ।
The Moon did hard austerity for a thousand years, living on fruits and roots.
पूर्णे वर्षसहस्रे तु चतुर्थे वरवर्णिनि ।
After four thousand years Shiva was pleased and spoke to the Moon.
परितुष्टोऽस्मि ते चंद्र वरं वरय सुव्रत ।
Shiva, pleased, asks the Moon to choose a boon.