Release new version 0.20.2
[grml-autoconfig.git] / bin / save-config
index 9a7af99..63e41c7 100755 (executable)
   LC_ALL=C
   [[ $UID != 0 ]] && runas='sudo' # important for /etc
 
-  if [ -d /lib/live/mount/overlay ] ; then # since around December 2012
-    CHANGE_DIR='/lib/live/mount/overlay'
-  if [ -d /live/overlay ] ; then  # until around December 2012
-    CHANGE_DIR='/live/overlay'
-  elif [ -d /live/image ] ; then # old version
-    CHANGE_DIR='/live/image'
+  if [ -d /run/live/overlay/rw ] ; then # since Dec 2018
+    CHANGE_DIR='/run/live/overlay/rw'
+  elif [ -d /lib/live/mount/overlay/rw ] ; then # 2012 until Dec 2018, backwards compatibility
+    CHANGE_DIR='/lib/live/mount/overlay/rw'
   else
     echo "Error: no overlay directories found (like /lib/live/mount/overlay or /live/overlay)." >&2
     bailout; exit 1
   fi
 
-  if [ -d /live/rofs ] ; then
-    ORIG_DIR="$(find /live/rofs/ -maxdepth 1 -name \*.squashfs | head -1)"
-  else # old version
-    ORIG_DIR="/GRML"
+  if [ -d /run/live/rootfs ] ; then
+    ORIG_DIR="$(find /run/live/rootfs/ -maxdepth 1 -name \*.squashfs | head -1)"
+  elif [ -d /lib/live/mount/rootfs ] ; then
+    ORIG_DIR="$(find /lib/live/mount/rootfs/ -maxdepth 1 -name \*.squashfs | head -1)"
+  else
+    echo "Error: no rootfs directories found in '/run/live/rootfs' or '/lib/live/mount/rootfs'." >&2
+    bailout; exit 1
   fi
 
   check4progs mutt &>/dev/null || echo "Warning, mutt not available for mail handling.">&2