From 90db1084ec0bdbcfd262797e5ad4693a4f678025 Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Sun, 19 Dec 2021 01:08:43 +0100 Subject: [PATCH] Update install-new-roundcube.sh --- .../for-download/tools/install-new-roundcube.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/deb/for-download/tools/install-new-roundcube.sh b/src/deb/for-download/tools/install-new-roundcube.sh index 7350db165..42ac73a0f 100644 --- a/src/deb/for-download/tools/install-new-roundcube.sh +++ b/src/deb/for-download/tools/install-new-roundcube.sh @@ -84,15 +84,16 @@ if [ "$pub_ip" != "$domain_host_ip" ]; then fi number_of_files=$(ls /home/$USER/web/$DOMAIN/public_html | wc -l) -if [ $number_of_files -eq 2 ] && [ -f "/home/$USER/web/$DOMAIN/public_html/index.html" ] && [ -f "/home/$USER/web/$DOMAIN/public_html/robots.txt" ]; then - rm /home/$USER/web/$DOMAIN/public_html/index.html - rm /home/$USER/web/$DOMAIN/public_html/robots.txt -else - echo "== public_html folder is not empty, aborting." - exit 1 +if [ $number_of_files -ne 0 ]; then + if [ $number_of_files -eq 2 ] && [ -f "/home/$USER/web/$DOMAIN/public_html/index.html" ] && [ -f "/home/$USER/web/$DOMAIN/public_html/robots.txt" ]; then + rm /home/$USER/web/$DOMAIN/public_html/index.html + rm /home/$USER/web/$DOMAIN/public_html/robots.txt + else + echo "== public_html folder is not empty, aborting." + exit 1 + fi fi - if [ ! -f "/home/$USER/conf/web/ssl.$DOMAIN.ca" ]; then www_host="www.$DOMAIN" www_host_ip=$(host $www_host | head -n 1 | awk '{print $NF}')