Skip to content
This repository has been archived by the owner on Oct 12, 2021. It is now read-only.

Commit

Permalink
now handles multiple WP sites
Browse files Browse the repository at this point in the history
  • Loading branch information
LuluTchab committed Nov 16, 2017
1 parent ad2d4a1 commit 2fef0bc
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions bin/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,33 @@

htDocsDir=`find volumes/srv/$1/ -name htdocs`


# If 'htdocs' folder found,
# If one or more 'htdocs' folder found,
if [ "${htDocsDir}" != "" ]
then
then

# looping through 'htdocs' folder found using FD 9 (http://mywiki.wooledge.org/BashFAQ/089)
while read -r path <&9
do
echo -n "Following folder will be deleted, please confirm (${path}) - (yes/no): "
read -r answer


if [ "${answer}" = "yes" ]
then
echo "Cleaning WP files ($path)..."
if [ -e ${path} ]
then
sudo rm -r ${path}
fi
else
echo "Skipping WP files deletion!"
fi

done 9<<< "${htDocsDir}"


echo -n "Following folder will be deleted, please confirm (${htDocsDir}) - (yes/no): "
read answer


if [ "${answer}" = "yes" ]
then
echo "Cleaning WP files..."
if [ -e ${htDocsDir} ]
then
sudo rm -r ${htDocsDir}
fi
else
echo "Skipping WP files deletion!"
fi

else
echo "WP files already cleaned!"
Expand All @@ -34,4 +42,3 @@ then
else
echo "DB files already cleaned!"
fi

0 comments on commit 2fef0bc

Please sign in to comment.