1 # --- SDE-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # Filename: package/.../dictd/stone_mod_dictd.sh
5 # Copyright (C) 2008 The OpenSDE Project
6 # Copyright (C) 2004 - 2006 The T2 SDE Project
7 # Copyright (C) 1998 - 2004 Clifford Wolf
9 # More information can be found in the files COPYING and README.
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; version 2 of the License. A copy of the
14 # GNU General Public License can be found in the file COPYING.
15 # --- SDE-COPYRIGHT-NOTE-END ---
19 # [MAIN] 80 dictd Configuration for dictionary server
24 list_dictionaries
() {
26 for i
in $
( ls /usr
/share
/dictd
/*.index
)
28 ds
="$ds `basename $i .index`"
33 if grep "database[[:space:]]\+\"$1\"" $conf 2>&1 >/dev
/null
35 # delete entry if it is not for select all
36 if [ "$2" != "1" ] ; then
37 perl
-i -00 -p -e"s/database\s+\"$1\"\s+\{.+\}//s" $conf
40 # set entry if it is not in unselect all mode
41 if [ "$2" != "0" ] ; then
45 data "/usr/share/dictd/$1.dict.dz"
46 index "/usr/share/dictd/$1.index"
53 select_dictionaries
() {
55 cmd
="gui_menu dictd 'Select the dictionaries which"
56 cmd
="$cmd will be served by dictd.'"
59 if [ -z "$ds" ] ; then gui_message \
60 "Stone can not find any dictionary. Please install one!"
65 if grep "database[[:space:]]\+\"$dic\"" $conf 2>&1 >/dev
/null
67 dics
=$
(printf "%-10sOK" "$dic")
69 dics
=$
(printf "%-10s--" "$dic")
71 cmd
="$cmd '$dics' 'select_dict \"$dic\"'"
96 cmd
="gui_menu dictd 'Configuration for dictionary server' "
98 if [ -z "$ds" ] ; then gui_message \
99 "There is no dictionary installed. Please install one."
102 cmd
="$cmd 'Select dictionaries' 'select_dictionaries'"
103 cmd
="$cmd 'Select all installed dictionaries' 'all_dictionaries'"
104 cmd
="$cmd 'Deselect all dictionaries' 'deselect_all'"
105 cmd
="$cmd 'Edit $conf' 'gui_edit DICTD $conf'"