#! /bin/sh

# This shell script gets called by vgetty if a DTMF
# command is detected, the digits heard are stored
# in $1 (not including the leading * and trailing #).

# Play the new messages if the code is correct.
# Required: a file called .code containing an ascii number.

# The variable below should be set by the Makefile.
# If you see three '@'s, the `make install' didn't work.
VOICE_DIR=@@@VDIR@@@

PATH=$VOICE_DIR:/bin:/usr/bin:/usr/local/bin

CODE=`cat $VOICE_DIR/.code`

# we were called remotely, check the passwd
OUTPUT=telco
if [ "$1" != "$CODE" ]
then
	# spy alert !!!!!!!
	exit 1
fi

vg_nmp "telco"
