#!/bin/bash

#16.04.2 and later
grep -q -E "aufs\s+\/\s+aufs" /proc/mounts
AURC=$?

#16.04.1 and earlier
grep -q -E "^/cow"  /proc/mounts
COWRC=$?


if [ $AURC -eq 0 ] || [ $COWRC -eq 0  ] ; then

	#if we get to this point we're running in a live dvd but we might be doing install
	# which we don't consider as "live"

	egrep "gxinstall|ubiquity" /proc/mounts
	if [ $? -eq 0 ] ; then
		#we're doing an install
		exit 2
	else
		#we're not doing an install
		exit 0
	fi

else
	exit 1
fi
