blob: e6bc48ccb576b539aeefb9fd70ee6682c0798abe [file] [log] [blame]
Brian Waters13d96012017-12-08 16:53:31 -06001#Copyright (c) 2017 Sprint
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15#!/bin/sh
16
17usage ()
18{
19 echo "Usage: $0 <dictionary name> <ON|OFF> <config file>"
20}
21
22if [ "$#" -ne 3 ]; then
23 usage
24 exit 0
25fi
26
27if [ "$2" != "ON" ] && [ "$2" != "OFF" ]; then
28 usage
29 exit
30fi
31
32DCTDIR=$1
33STATE=$2
34CFGFILE=$3
35
36if [ -e $3 ]; then
37 if [ -d "dict_${DCTDIR}" ]; then
38 if [ -e "dict_${DCTDIR}/${DCTDIR}.did" ]; then
39 while read p; do
40 echo "Turning $p $2"
41 ./fddict_conf.sh $p $2 $3
42 done <dict_${DCTDIR}/${DCTDIR}.did
43 else
44 echo "dict_${DCTDIR}.did was not present - skipping"
45 fi
46 else
47 echo "Directory dict_${DCTDIR} doesn't exist\n"
48 fi
49else
50 echo "File $3 doesn't exist. Please provide valid config file\n"
51fi