Check if a file exists on a remote server

I was working on a copy WordPress site to a local machine script, and I wanted to check if the remote path was a WordPress site.
Here is the code I used.

CHECKCMD="ls /path/to/wp-config.php | grep wp-config.php > /dev/null; echo \$?"
if [ $CHECKFILE -eq 0 ]; then
	echo "file exists"


Comments are closed.

Powered by WordPress. Designed by WooThemes