Manual:PageExists.php

Details
pageExists.php file is a maint-scripts>Special:MyLanguage/Manual:Maintenance scripts|maintenance script to report whether a page with a specific title exists.

It will print out the result to standard output with a meaningful text, and will set the exit status of the script to 0 if the page exists.