From b0c92bacdd994e74051ddf75e7017264e6f0f0a4 Mon Sep 17 00:00:00 2001 From: Justin DiRose Date: Wed, 11 Mar 2020 13:55:10 -0500 Subject: [PATCH] FEATURE: Give option to publish log file publicly (#459) --- discourse-doctor | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/discourse-doctor b/discourse-doctor index 92796e5..67c4739 100755 --- a/discourse-doctor +++ b/discourse-doctor @@ -316,10 +316,16 @@ print_done() { if [ $app_name == 'app' ] && [ "$NO_CONTAINER" != 'y' ] then - cp $LOG_FILE shared/standalone/log/var-log/$DOCTOR_FILE - sudo docker exec -w /var/www/discourse -i $app_name cp /var/log/$DOCTOR_FILE public - log "The output of this program may be available at http://$DISCOURSE_HOSTNAME/$DOCTOR_FILE" - log "You should inspect that file carefully before sharing the URL." + read -p "Would you like to serve a publicly available version of this file? (Y/n)" serve + if [ $serve == 'Y' ] + then + cp $LOG_FILE shared/standalone/log/var-log/$DOCTOR_FILE + sudo docker exec -w /var/www/discourse -i $app_name cp /var/log/$DOCTOR_FILE public + log "The output of this program may be available at http://$DISCOURSE_HOSTNAME/$DOCTOR_FILE" + log "You should inspect that file carefully before sharing the URL." + else + log "Publicly available log not generated." + fi fi # The following is not in the web log file since it was copied above, which seems corect log -- 2.25.1