Annotation of /alx-src/branches/alxconf-060/plugins/egk-scm/plugin.sh
Parent Directory | Revision Log
Revision 3504 -
(hide annotations)
(download)
(as text)
Thu Apr 19 13:27:58 2012 UTC (12 years ago) by niro
File MIME type: application/x-sh
File size: 1883 byte(s)
Thu Apr 19 13:27:58 2012 UTC (12 years ago) by niro
File MIME type: application/x-sh
File size: 1883 byte(s)
-export PLUGIN_MENUITEM_NAME in autostart function which is used as name for the generated sh script
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 | niro | 3504 | echo "PLUGIN_MENUITEM_NAME=\"${PLUGIN_MENUITEM_NAME}\"" |
54 | niro | 3503 | } |
55 | |||
56 | niro | 3393 | uninstall_plugin() |
57 | { | ||
58 | local i | ||
59 | for i in ${PLUGIN_PACKAGES} | ||
60 | do | ||
61 | if [[ -n $(magequery -n ${i}) ]] | ||
62 | then | ||
63 | MAGE_BOOTSTRAP=true mage uninstall ${i} | ||
64 | mage clean | ||
65 | fi | ||
66 | done | ||
67 | |||
68 | mage clean | ||
69 | } | ||
70 | |||
71 | case $1 in | ||
72 | install) install_plugin ;; | ||
73 | setup) setup_plugin ;; | ||
74 | menuitem) create_menuitem ;; | ||
75 | niro | 3503 | autostart) autostart_plugin ;; |
76 | niro | 3393 | uninstall) uninstall_plugin ;; |
77 | *) echo "PLUGIN '${PLUGIN_NAME}': unkown operation '$1'" ;; | ||
78 | esac |