1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../dictd/mod_dictd.sh
5 # Copyright (C) 2004 - 2006 The T2 SDE Project
6 # Copyright (C) 1998 - 2004 ROCK Linux Project
8 # More information can be found in the files COPYING and README.
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; version 2 of the License. A copy of the
13 # GNU General Public License can be found in the file COPYING.
14 # --- T2-COPYRIGHT-NOTE-END ---
18 # [MAIN] 80 dictd Configuration for dictionary server
23 list_dictionaries
() {
25 for i
in $
( ls /usr
/share
/dictd
/*.index
)
27 ds
="$ds `basename $i .index`"
32 if grep "database[[:space:]]\+\"$1\"" $conf 2>&1 >/dev
/null
34 # delete entry if it is not for select all
35 if [ "$2" != "1" ] ; then
36 perl
-i -00 -p -e"s/database\s+\"$1\"\s+\{.+\}//s" $conf
39 # set entry if it is not in unselect all mode
40 if [ "$2" != "0" ] ; then
44 data "/usr/share/dictd/$1.dict.dz"
45 index "/usr/share/dictd/$1.index"
52 select_dictionaries
() {
54 cmd
="gui_menu dictd 'Select the dictionaries which"
55 cmd
="$cmd will be served by dictd.'"
58 if [ -z "$ds" ] ; then gui_message \
59 "Stone can not find any dictionary. Please install one!"
64 if grep "database[[:space:]]\+\"$dic\"" $conf 2>&1 >/dev
/null
66 dics
=$
(printf "%-10sOK" "$dic")
68 dics
=$
(printf "%-10s--" "$dic")
70 cmd
="$cmd '$dics' 'select_dict \"$dic\"'"
95 cmd
="gui_menu dictd 'Configuration for dictionary server' "
97 if [ -z "$ds" ] ; then gui_message \
98 "There is no dictionary installed. Please install one."
101 cmd
="$cmd 'Select dictionaries' 'select_dictionaries'"
102 cmd
="$cmd 'Select all installed dictionaries' 'all_dictionaries'"
103 cmd
="$cmd 'Deselect all dictionaries' 'deselect_all'"
104 cmd
="$cmd 'Edit $conf' 'gui_edit DICTD $conf'"