#!/bin/bash
#
# by: Brian Butler (20100922)
#
# Grading script for the Secure Linux File Access lab
# this script is to be installed and run on serverX.example.com
# output is logged to syslog

# Set environment and declare global variables
. /usr/local/lib/labtool.shlib
trap on_exit EXIT
LOG_FACILITY=local0
LOG_PRIORITY=info
LOG_TAG=sambaLab
DEBUG=false
ERROR_MESSAGE="Error running script. Contact your instructor if you continue to see this message."
PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
userInput="no"
set -o pipefail

# Check to make sure we are running as root
check_root

# Check to make sure we are running on the correct host
check_host "server"

# Check that /home/stooges exists and has the correct permissions & group
ERROR_MESSAGE="FAILED."
echo
echo -n 'Checking that /home/stooges is setup for collaboration... '
(ls -ld /home/stooges | cut -d' ' -f1,4 | grep "^drwxrws---. stooges$" &> /dev/null) || exit 1
echo "PASSED."
echo
echo "Lab Successfully Completed!"
exit 0
