#!/bin/sh

FS=$(ls /usr/share/marionnet/filesystems/ | grep -v '\.conf$' | wc -l)
if [ ! \( -d /usr/share/marionnet/filesystems/ -a "$FS" -gt 0 -a -d /usr/share/marionnet/kernels \) ]; then
  cat <<-EOF
  /!\\  No kernels/filesystems for marionnet found!  /!\\
  Marionnet will start with very limited functionality.

  For more information about donwloading kernels and filesystems,
  read /usr/share/doc/marionnet/README.Debian

EOF
fi
if ps -C Xorg | grep -q -- '-nolisten tcp'; then
  cat <<-EOF
  /!\\  Xorg running with -nolisten tcp  /!\\
  It seems that Xorg is running with -nolisten tcp. You will not be able
  to run graphical applications inside Marionnet virtual machines.

  For more information about fixing your Xorg configuration,
  read /usr/share/doc/marionnet/README.Debian

EOF
fi
