#!/bin/sh
#
# The script to add specified output support to the VoiceMan speech system.
# It creates symlink /etc/voiceman.d/<name>.output to /etc/tts.d/<name>.voiceman.
# Copyright (c) 2000-2010 Michael Pozhidaev <msp@altlinux.org>

THIS="${0##*/}"

if [ -z "$1" ]; then
    echo "$THIS:TTS name is not specified" >&2
    exit 1
fi

LINKNAME="/etc/voiceman.d/$1.output"
DESTNAME="/etc/tts.d/$1.voiceman"

if ! [ -e "$DESTNAME" ]; then
    echo "$THIS:$DESTNAME does not exist" >&2
    exit 1
fi

/bin/ln -s "$DESTNAME" "$LINKNAME"
exit $?
