aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Bottomley <JBottomley@Parallels.com>2014-07-24 17:03:32 -0700
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2020-12-06 11:37:10 -0800
commit4653a2018d75cc715757d20d5c1eda54a3db836f (patch)
tree0464ba404aa25ef849227a9d49fd1b2d268d9e40
parent75be4bf6a801db800e45fdce3ef3b977f3c7913c (diff)
downloadricoh-sp100-4653a2018d75cc715757d20d5c1eda54a3db836f.tar.gz
pstoricohddst-gdi: make DEBUG an environment variable
More useful than editing the script to get debugging. Also remove output dir only if DEBUG != yes Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rwxr-xr-xpstoricohddst-gdi5
1 files changed, 3 insertions, 2 deletions
diff --git a/pstoricohddst-gdi b/pstoricohddst-gdi
index 9db3b13..1e10679 100755
--- a/pstoricohddst-gdi
+++ b/pstoricohddst-gdi
@@ -1,7 +1,7 @@
#!/bin/bash
# Debug mode: change to 'yes' to enable
-DEBUG=no
+DEBUG=${DEBUG-no}
function log() {
[ "${DEBUG}" = "yes" ] && echo $* | logger -t "$0[$$]"
@@ -177,6 +177,7 @@ mkdir -p $uid
}
-#rm -rf $uid;
+# only remove the output dir if not debugging
+[ ! "${DEBUG}" = "yes" ] && rm -rf $uid;
exit 0