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
... | ... |
@@ -114,9 +114,16 @@ sudo rm -f /etc/tgt/conf.d/* |
114 | 114 |
cleanup_rpc_backend |
115 | 115 |
cleanup_database |
116 | 116 |
|
117 |
-# Clean out data, logs and status |
|
118 |
-LOGDIR=$(dirname "$LOGFILE") |
|
119 |
-sudo rm -rf $DATA_DIR $LOGDIR $DEST/status |
|
117 |
+# Clean out data and status |
|
118 |
+sudo rm -rf $DATA_DIR $DEST/status |
|
119 |
+ |
|
120 |
+# Clean out the log file and log directories |
|
121 |
+if [[ -n "$LOGFILE" ]] && [[ -f "$LOGFILE" ]]; then |
|
122 |
+ sudo rm -f $LOGFILE |
|
123 |
+fi |
|
124 |
+if [[ -n "$LOGDIR" ]] && [[ -d "$LOGDIR" ]]; then |
|
125 |
+ sudo rm -rf $LOGDIR |
|
126 |
+fi |
|
120 | 127 |
if [[ -n "$SCREEN_LOGDIR" ]] && [[ -d "$SCREEN_LOGDIR" ]]; then |
121 | 128 |
sudo rm -rf $SCREEN_LOGDIR |
122 | 129 |
fi |