#!/bin/bash
#
#  NAME
#       trn-break-fstab - break the network configuration
#
#  USAGE
#       trn-break-fstab
#
#  DESCRIPTION
#       This script breaks the fstab file.
#       This script is used in the demonstration that teaches learners
#       how to troubleshoot the boot process.
#
#  CHANGELOG
#       * Tue Aug 31 2010 Robert Locke <rlocke@redhat.com>
#       - Original code

# Get some current information
CFGFILE=/etc/fstab
NAME=$(hostname -s)

# Must only be run on server virtual machine
if [ "${NAME:0:6}" != "server" ] && [ "${NAME}" != "demo" ] ; then
    cat <<EOF
$0 is designed to be run on your virtual server.

Please connect to that system to run this script/exercise.
EOF
    exit 2
fi

# Must be run as root
if [ "$EUID" -ne 0 ]; then
    echo You must run this script as root
    exit 3
fi

sed -i -e 's/home/hme/' ${CFGFILE}

shutdown -r now

