#!/bin/sh
#
# The script to remove all references to the TTS engine being removing from the system.
# from different configuration files and settings.
#
# This script must be called from RPM spec file in %preun section 
# with the single command line argument - name of a TTS being remove.
# Example: /usr/sbin/tts-unregister espeak
#
# Michael Pozhidaev <msp@altlinux.org>
# Date: 2011-02-07

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

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

VOICEMAN_FILE="/etc/voiceman.d/$1.output"

if [ -L "$VOICEMAN_FILE" ]; then
    echo "$THIS:removing $VOICEMAN_FILE"
    /bin/rm -f "$VOICEMAN_FILE"
fi
