#!/bin/bash

set -e

#Execute only when booted from a snapshot and the fstab=no CMDLINE was defined
grep -E '(kaisen-grub-btrfs|fstab=no)' /proc/cmdline &> /dev/null || exit 0

#Umount only /boot recursively partition
if [ "`mount | grep -w /sys/firmware/efi/efivars | awk '{ print $3 }'`" = "/sys/firmware/efi/efivars" ]; then
	umount --recursive --force /sys/firmware/efi/efivars
fi

#Do not start the conky
if [ -e /etc/xdg/autostart/kaisen-conky.desktop ]; then
	rm -f /etc/xdg/autostart/kaisen-conky.desktop
fi
