#!/bin/sh
# set/display ZyXEL answering state for specified tty.
# this is only to be used when distinctive ringing is not in use, as it
# only writes a single-line statefile.  when you have distinctive ringing,
# you probably never modify the statefile anyway, and just create it using
# an editor.

case $# in
    0)	echo "Usage: $0 <ttyname> [<newstate>]"
    	exit 1
    	;;

    1)	cat /usr/ZyXEL/state.$1
    	;;

    *)  tty=$1
    	shift
    	echo $* >/usr/ZyXEL/state.$tty
    	;;
esac
