#!/bin/bash
# Afrihost - list possible sitepad sites
if ! [ -f  /usr/local/sitepad/universal.php ] ; then echo "== SitePad not installed on this server, contact SA" ; else 
echo "Local sitepad upload server is set to: "$(grep host_sm  /usr/local/sitepad/universal.php | awk '{print $NF}' | sed 's/;//')""
#find /home/*/public_html -maxdepth 1  -name index.html -exec grep -l  sitepad {} \; 
fi
find /home/*/public_html -maxdepth 2  -name index.html -name index.php -exec grep -l  sitepad  {} \; |  while read pdile ; do echo $(echo $pdile |  awk -F "/" '{print $3}' | xargs -i grep {} /etc/trueuserdomains | awk -F ":" '{print $1}')  "$(echo $pdile |  awk -F "/" '{print $3}')  $pdile" ;done 
