From 2dfd2c6de41357bb10501e08ad0db1a7ed965505 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 17 Apr 2018 13:55:02 +0800 Subject: [PATCH] Prompt user to remove old PG backup data cluster. --- launcher | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 } -- 2.25.1