Warn if update option is used without chroot being present
authorMichael Prokop <devnull@localhost>
Mon, 29 Oct 2007 23:30:57 +0000 (00:30 +0100)
committerMichael Prokop <devnull@localhost>
Mon, 29 Oct 2007 23:30:57 +0000 (00:30 +0100)
grml-live

index 00e4a7e..2546753 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -305,6 +305,15 @@ else
    FAI_ACTION=dirinstall
 fi
 
+if [ -n "$UPDATE" ] ; then
+   if ! [ -r "$CHROOT_OUTPUT/etc/grml_version" ] ; then
+      log "Error: It does not look like you have a working chroot system. Updating not possible."
+      eerror "Error: It does not look like you have a working chroot system. Updating not possible."
+      eend 1
+      bailout 20
+   fi
+fi
+
 if [ -d "$CHROOT_OUTPUT/bin" -a -z "$UPDATE" ] ; then
    log "$CHROOT_OUTPUT exists already, skipping stage 'fai dirinstall'"
    ewarn "$CHROOT_OUTPUT exists already, skipping stage 'fai dirinstall'" ; eend 0