#!/bin/sh 
#
# Version 1.0
# 19 Feb 1997
# TjL <luomat@peak.org>
#
# This file should be saved as ~/.LogoutHook to make it work
# Use at your own risk
#
# You'll need the "Alert" binary from the ShellPanel package available
# on the FTP sites.

/usr/local/bin/Alert "Empty Recycler?" Yes No

if [ $? = 0 ]
then
	# Empty Recycler but do not delete folder
	/bin/rm -rf $HOME/.NeXT/.NextTrash/* 
fi

/usr/local/bin/Alert "Reboot?" "Don't Reboot" "Reboot" "Power off"

exitcode="$?"


if [ "$exitcode" = "2" ]
then
	# power off -- this must be run as root
	/usr/etc/shutdown -h -p +1

elif [ "$exitcode" = "1" ]
then
	# reboot -- this must be run as root
	/usr/etc/shutdown -r +1

else
	exit 0
fi


exit 0
