Magellan Linux

Annotation of /alx-src/branches/alxconf-060/plugins/egk-scm/plugin.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3503 - (hide annotations) (download) (as text)
Thu Apr 19 12:17:20 2012 UTC (12 years ago) by niro
File MIME type: application/x-sh
File size: 1826 byte(s)
-added autostart support for plugins
1 niro 3393 # this script gets included by config_sessions
2    
3 niro 3470 PLUGIN_NAME="egk-scm"
4 niro 3393 PLUGIN_MENUITEM_NAME="SUM_EGK"
5     PLUGIN_MENUITEM_EXEC="rdesktop"
6 niro 3494 PLUGIN_MENUITEM_PARAM='-r scard:\"eHealth200 Terminal 00 00\"=\"SCM Microsystems Inc. Terminal0-Patient slot 0\",\"eHealth200 Terminal 00 01\"=\"SCM Microsystems Inc. Terminal0-Doctor slot 0\"'
7 niro 3393 PLUGIN_MENUITEM_WORKDIR=""
8     PLUGIN_MENUITEM_ICON=""
9    
10 niro 3503 PLUGIN_AUTOSTART=1
11    
12 niro 3393 PLUGIN_PACKAGES="libusb libusb-compat pcsc-lite pcsc-plugin-ehealth200"
13    
14     install_plugin()
15     {
16     local i
17     for i in ${PLUGIN_PACKAGES}
18     do
19     if [[ -z $(magequery -n ${i}) ]]
20     then
21     MAGE_BOOTSTRAP=true mage install ${i}
22     mage clean
23     fi
24     done
25     }
26    
27     setup_plugin()
28     {
29     return 0
30     }
31    
32     # create desktop buttons
33     create_menuitem()
34     {
35 niro 3494 if [ -f /etc/alxconfig-ng/plugin-rdesktop.conf ]
36     then
37     source /etc/alxconfig-ng/plugin-rdesktop.conf
38     fi
39     [[ -z ${PLUGIN_CONFIG_PARAM} ]] && PLUGIN_CONFIG_PARAM=""
40     [[ -z ${PLUGIN_CONFIG_SERVER} ]] && PLUGIN_CONFIG_SERVER=""
41    
42 niro 3393 # don't touch these echo, define variables above
43     echo "PLUGIN_MENUITEM_NAME=\"${PLUGIN_MENUITEM_NAME}\""
44     echo "PLUGIN_MENUITEM_EXEC=\"${PLUGIN_MENUITEM_EXEC}\""
45 niro 3494 echo "PLUGIN_MENUITEM_PARAM=\"${PLUGIN_CONFIG_PARAM} ${PLUGIN_MENUITEM_PARAM} ${PLUGIN_CONFIG_SERVER}\""
46 niro 3393 echo "PLUGIN_MENUITEM_WORKDIR=\"${PLUGIN_MENUITEM_WORKDIR}\""
47     echo "PLUGIN_MENUITEM_ICON=\"${PLUGIN_MENUITEM_ICON}\""
48     }
49    
50 niro 3503 autostart_plugin()
51     {
52     echo "PLUGIN_AUTOSTART=\"${PLUGIN_AUTOSTART}\""
53     }
54    
55 niro 3393 uninstall_plugin()
56     {
57     local i
58     for i in ${PLUGIN_PACKAGES}
59     do
60     if [[ -n $(magequery -n ${i}) ]]
61     then
62     MAGE_BOOTSTRAP=true mage uninstall ${i}
63     mage clean
64     fi
65     done
66    
67     mage clean
68     }
69    
70     case $1 in
71     install) install_plugin ;;
72     setup) setup_plugin ;;
73     menuitem) create_menuitem ;;
74 niro 3503 autostart) autostart_plugin ;;
75 niro 3393 uninstall) uninstall_plugin ;;
76     *) echo "PLUGIN '${PLUGIN_NAME}': unkown operation '$1'" ;;
77     esac