#! /bin/sh

case $1 in
	y*|Y*)
		chmod og+w `tty`
		;;
	n*|N*)
		chmod og-w `tty`
		;;
	*)
		if ls -l `tty` | grep 'rw--w--w-' > /dev/null; then
			echo "mesg is y"
		else
			echo "mesg is n"
		fi
		;;
esac
