From: Guo Xiang Tan Date: Tue, 17 Apr 2018 05:55:02 +0000 (+0800) Subject: Prompt user to remove old PG backup data cluster. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2dfd2c6de41357bb10501e08ad0db1a7ed965505;p=discourse_docker.git Prompt user to remove old PG backup data cluster. --- diff --git a/launcher b/launcher index 97ea535..9d44cda 100755 --- a/launcher +++ b/launcher @@ -406,6 +406,20 @@ fi else exit 1 fi + + if [ -d /var/discourse/shared/standalone/postgres_data_old ]; then + echo + echo "Old PostgreSQL backup data cluster detected taking up $(du -hs /var/discourse/shared/standalone/postgres_data_old | awk '{print $1}') detected" + read -p "Would you like to remove it? (Y/n): " -n 1 -r && echo + + if [[ $REPLY =~ ^[Yy]$ ]]; then + echo "removing old PostgreSQL data cluster at /var/discourse/shared/standalone/postgres_data_old..." + rm -rf /var/discourse/shared/standalone/postgres_data_old + else + exit 1 + fi + fi + exit 0 }