#!/bin/sh

# set the default logout script
if [ "$1" ]; then
  logout=$1
else
  logout=${HOME}/.logout
fi

# exit on HUP, ignore INT and TERM
trap "echo Gates are closing.; exec $logout" 1
trap "echo $0: SIGNAL IGNORED; continue" 2 15

# be nice to other stuff (though it probably doesn't matter much)
if [ -r /etc/renice ]; then RENICE=/etc/renice; else RENICE=renice; fi
${RENICE} +19 -p $$ 2>&1 >/dev/null

echo "Gates have opened."

while sleep 60; do sleep 60; done;
