Skip to content
This repository was archived by the owner on Aug 10, 2020. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion scripts/ee4
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ help () {

echo -e "\nCommands: "
echo -e "\tcreate\t\t\tCreate new site"
echo -e "\tdb\t\t\tEnter mysql shell"
echo -e "\tlist\t\t\tShow the list of created sites"
echo -e "\tdb\t\t\tEnter mysql shell"
echo -e "\tdelete\t\t\tDelete existing site"
echo -e "\trestart\t\t\tReload configuration for existing site"
echo -e "\twp\t\t\tUse wp-cli with a site"
Expand Down Expand Up @@ -59,6 +60,20 @@ createWebroot()
fi
}

# show the list of sites
listSites() {
pushd $WEBROOT > /dev/null 2>&1
SITE_LIST=$(find . -mindepth 2 -maxdepth 2 -name docker-compose.yml | xargs -I{} dirname {} | cut -c3-)
popd > /dev/null 2>&1
if [[ ${#SITE_LIST} -eq 0 ]]; then
echo -e "No sites have been created."
else
echo -e "List of Sites:\n\n$SITE_LIST"
fi
}



singleWordPress() {
createWebroot

Expand Down Expand Up @@ -366,6 +381,9 @@ while [[ $# -gt 0 ]]; do
exit 0
fi
;;
'list')
listSites
;;
'delete')
shift
if [[ $# -ne 0 ]]; then
Expand Down