From b47d0c480df34c1c15ac83166ae246991ce72385 Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel@debian.org>
Date: Mon, 12 Nov 2007 22:31:06 +0100
Subject: Adding a check to see if user is running lh_clean from a sane
 location (i.e. not config/), thanks to Kai Hendry <hendry@webconverger.com>.

---
 helpers/lh_clean | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/helpers/lh_clean b/helpers/lh_clean
index 3fa8fc5..166c867 100755
--- a/helpers/lh_clean
+++ b/helpers/lh_clean
@@ -42,6 +42,13 @@ else
 	ARGUMENTS="${@}"
 fi
 
+# Avoid cases were users accidentally nuke their config/binary
+if [ ! -d config ] || [ "$(basename ${PWD})" = "config" ]
+then
+	Echo_error "${PWD} is not a good Debian Live working directory to clean."
+	exit 1
+fi
+
 for ARGUMENT in ${ARGUMENTS}
 do
 	case "${ARGUMENT}" in
-- 
cgit v1.0