From 27c41d72bd54e9f5334269a14a7232534061434f Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 25 Apr 2012 15:30:33 +0200 Subject: [PATCH] check for existence of /etc/grml and /live produces a nicer error when called outside a Grml session --- remaster/grml-live-remaster | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/remaster/grml-live-remaster b/remaster/grml-live-remaster index 456dbab..39cc81b 100755 --- a/remaster/grml-live-remaster +++ b/remaster/grml-live-remaster @@ -24,6 +24,11 @@ set -e # exit on any error VERSION='0.0.2' GRML_LIVE_EDITOR=${VISUAL:-${EDITOR:-vi}} +if [ ! -d /etc/grml -o ! -d /live ]; then + echo "Error: $0 has to be run from a Grml live session. Exiting." + exit 1 +fi + # source core functions {{{ . /etc/grml/lsb-functions . /etc/grml/script-functions -- 2.1.4