Setting LOGFILE to a file in root directory wipes everything
clean.sh picks the parent of LOGFILE and wipes it clean! So if you set it to a log file in the users root directory, you lose everything We should delete just the LOGFILE and cleanup LOGDIR and SCREEN_LOGDIR if they are explicitly set. Change-Id: I45745427dcaed3dcf0b78cc9ed680833d9d555e8
This commit is contained in:
1 changed files with 10 additions and 3 deletions
13
clean.sh
13
clean.sh
@@ -114,9 +114,16 @@ sudo rm -f /etc/tgt/conf.d/*
cleanup_rpc_backend
cleanup_database
# Clean out data, logs and status
LOGDIR=$(dirname "$LOGFILE")
sudo rm -rf $DATA_DIR $LOGDIR $DEST/status
# Clean out data and status
sudo rm -rf $DATA_DIR $DEST/status
# Clean out the log file and log directories
if [[ -n "$LOGFILE" ]] && [[ -f "$LOGFILE" ]]; then
sudo rm -f $LOGFILE
fi
if [[ -n "$LOGDIR" ]] && [[ -d "$LOGDIR" ]]; then
sudo rm -rf $LOGDIR
fi
if [[ -n "$SCREEN_LOGDIR" ]] && [[ -d "$SCREEN_LOGDIR" ]]; then
sudo rm -rf $SCREEN_LOGDIR
fi
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.