#sccs	"@(#)fndetc:shutdown	1.6"

cd /
sync;sync

#----------------------------------------
# check if Line1 or Line 2 is configured
#----------------------------------------
# if Line 2 is configured, Line 1 must be configured; therefore
# only need to check status of Line 1

if [ -s /etc/.lineone ]
then	
	message -c "              WARNING!!!\n\nShutdown will disconnect any active phone conversations.  Please hang up any active calls before you continue."
	if [ "$?" != "0" ]
	then
		exit 8
	fi
fi

USERS=`who | wc -l | cut -c7-7`
if [ "$USERS" != "1" ]
then
        su adm -c /etc/wall <<!
                                            PLEASE LOG OFF NOW ! ! !                                         SYSTEM BEING BROUGHT DOWN IN 1 MINUTE                                                                                                                                                         
!
echo "\n\n\n\n\n                      IF YOU PLAN ON MOVING OR SHIPPING "
echo "                       THE UNIX PC, PLEASE REBOOT THE "
echo "                   DIAGNOSTIC DISK TO PARK THE DISK HEADS."          
        sleep 60
else
echo "\n\n\n\n\n                      IF YOU PLAN ON MOVING OR SHIPPING "
echo "                       THE UNIX PC, PLEASE REBOOT THE "
echo "                   DIAGNOSTIC DISK TO PARK THE DISK HEADS."          
fi
echo "\n\n\n\n\n\n                  Shutting the system down.   Please wait..."

/usr/lib/lpshut > /dev/null 2> /dev/null
sync;sync
init s
sleep 1
exit 0
