#!/bin/sh

# lessdisks-xterminal-install

# copyright 2004 vagrant@freegeek.org, distributed under the terms of the
# GNU General Public License version 2 or any later version.

cd /

if [ -r /etc/lessdisks/server.config ]; then
  # source config file
  . /etc/lessdisks/server.config
else
  echo "/etc/lessdisks/server.config file not readable"
  echo "exiting..."
  exit 1
fi
if [ -r /etc/lessdisks/x.config ]; then
  # source config file
  . /etc/lessdisks/x.config
else
  echo "/etc/lessdisks/x.config file not readable"
  echo "exiting..."
  exit 1
fi

#### add entries to inittab to start X in runlevels 4 and 5
# also add entries to show what the various runlevels do

echo "# lessdisks terminal x-sessions" >> etc/inittab
echo "# runlevel 2 is setup/default" >> etc/inittab
echo "# runlevel 3 is console only" >> etc/inittab
echo "# runlevel 4 starts X using $alt_x_display_command" >> etc/inittab
echo "# runlevel 5 starts X using $x_display_command" >> etc/inittab
echo "xl:45:respawn:/usr/sbin/lessdisks-xsession" >> etc/inittab

echo "lessdisks xterminal-install done!"
