diff options
Diffstat (limited to 'japanese/FreeWnn-server/pkg-install')
-rw-r--r-- | japanese/FreeWnn-server/pkg-install | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/japanese/FreeWnn-server/pkg-install b/japanese/FreeWnn-server/pkg-install index 9581b53e9ee5..612660afd0e0 100644 --- a/japanese/FreeWnn-server/pkg-install +++ b/japanese/FreeWnn-server/pkg-install @@ -145,29 +145,41 @@ POST-INSTALL) if [ ! -f ${startup_script} ]; then echo "Installing ${startup_script} startup file."; echo '#!/bin/sh' > ${startup_script}; - echo "wnn=${wnnserver}" >> ${startup_script}; - echo 'if [ -x $wnn ]; then' >> ${startup_script}; - echo " ${wnnstat} -L ${wnn_lang} localhost > /dev/null 2>&1" >> ${startup_script}; - echo ' if [ $? = 255 ]; then' >> ${startup_script}; - echo " rm -f ${wnn_socket}" >> ${startup_script}; - echo " echo -n ' ${wnnname}'" >> ${startup_script}; - echo ' $wnn' >> ${startup_script}; + echo 'case $1 in' >> ${startup_script}; + echo 'start)' >> ${startup_script}; + echo " wnn=${wnnserver}" >> ${startup_script}; + echo ' if [ -x $wnn ]; then' >> ${startup_script}; + echo " ${wnnstat} -L ${wnn_lang} localhost > /dev/null 2>&1" >> ${startup_script}; + echo ' if [ $? = 255 ]; then' >> ${startup_script}; + echo " rm -f ${wnn_socket}" >> ${startup_script}; + echo " echo -n ' ${wnnname}'" >> ${startup_script}; + echo ' $wnn' >> ${startup_script}; + echo " fi" >> ${startup_script}; echo " fi" >> ${startup_script}; - echo "fi" >> ${startup_script}; if [ $1 = zh-Wnn-4.2 ]; then wnnserver=${PKG_PREFIX}/bin/cWnn4/tserver wnn_lang=zh_TW wnn_socket=/tmp/td_sockV4 - echo "wnn=${wnnserver}" >> ${startup_script}; - echo 'if [ -x $wnn ]; then' >> ${startup_script}; - echo " ${wnnstat} -L ${wnn_lang} localhost > /dev/null 2>&1" >> ${startup_script}; - echo ' if [ $? = 255 ]; then' >> ${startup_script}; - echo " rm -f ${wnn_socket}" >> ${startup_script}; - echo " echo -n ' ${wnnname}'" >> ${startup_script}; - echo ' $wnn' >> ${startup_script}; + echo " wnn=${wnnserver}" >> ${startup_script}; + echo ' if [ -x $wnn ]; then' >> ${startup_script}; + echo " ${wnnstat} -L ${wnn_lang} localhost > /dev/null 2>&1" >> ${startup_script}; + echo ' if [ $? = 255 ]; then' >> ${startup_script}; + echo " rm -f ${wnn_socket}" >> ${startup_script}; + echo " echo -n ' ${wnnname}'" >> ${startup_script}; + echo ' $wnn' >> ${startup_script}; + echo " fi" >> ${startup_script}; echo " fi" >> ${startup_script}; - echo "fi" >> ${startup_script}; fi + echo ' ;;' >> ${startup_script}; + echo 'stop)' >> ${startup_script}; + echo ' killall $wnn' >> ${startup_script}; + echo " echo -n ' ${wnnname}'" >> ${startup_script}; + echo ' ;;' >> ${startup_script}; + echo '*)' >> ${startup_script}; + echo ' echo "Usage: `basename $0` {start|stop}" >&2' >> ${startup_script}; + echo ' ;;' >> ${startup_script}; + echo 'esac' >> ${startup_script}; + echo 'exit 0' >> ${startup_script}; chmod 755 ${startup_script}; chown bin.bin ${startup_script}; fi |