message: prevent errors and wrap in an if.
diff: @@ -6,6 +6,7 @@ set -ex
  # new volume looks like this
  # $corename/-files-
  +if [ -n "$(ls /var/solr)" ]; then
  for datadir in $(ls -d /var/solr/*) ; do
  corename=$(basename $datadir)
  if [ -d ${datadir}/data ]; then
  @@ -30,5 +31,6 @@ for datadir in $(ls -d /var/solr/*) ; do
  sed -ibak 's/<dataDir>.*/<dataDir>\/var\/solr\/${solr.core.name}<\/dataDir>/' /opt/solr/server/solr/${corename}/conf/solrconfig.xml
  done
  +fi
  exec solr-foreground
  