Magellan Linux

Contents of /alx-src/branches/alxconf-060/plugins/rdesktop/plugin.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3504 - (show 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: 1832 byte(s)
-export PLUGIN_MENUITEM_NAME in autostart function which is used as name for the generated sh script
1 # this script gets included by config_sessions
2
3 PLUGIN_NAME="rdesktop"
4 PLUGIN_MENUITEM_NAME=""
5 PLUGIN_MENUITEM_EXEC=""
6 PLUGIN_MENUITEM_PARAM=""
7 PLUGIN_MENUITEM_WORKDIR=""
8 PLUGIN_MENUITEM_ICON=""
9
10 PLUGIN_AUTOSTART=0
11
12 PLUGIN_PACKAGES="openssl rdesktop"
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 if [ ! -f /etc/alxconfig-ng/plugin-${PLUGIN_NAME}.conf ]
30 then
31 install /usr/lib/alxconfig-ng/plugins/${PLUGIN_NAME}/plugin-${PLUGIN_NAME}.conf /etc/alxconfig-ng
32 fi
33
34 return 0
35 }
36
37 # create desktop buttons
38 create_menuitem()
39 {
40 if [ -f /etc/alxconfig-ng/plugin-rdesktop.conf ]
41 then
42 source /etc/alxconfig-ng/plugin-rdesktop.conf
43 fi
44 [[ -z ${PLUGIN_CONFIG_PARAM} ]] && PLUGIN_CONFIG_PARAM=""
45 [[ -z ${PLUGIN_CONFIG_SERVER} ]] && PLUGIN_CONFIG_SERVER=""
46
47 # don't touch these echo, define variables above
48 echo "PLUGIN_MENUITEM_NAME=\"${PLUGIN_MENUITEM_NAME}\""
49 echo "PLUGIN_MENUITEM_EXEC=\"${PLUGIN_MENUITEM_EXEC}\""
50 echo "PLUGIN_MENUITEM_PARAM=\"${PLUGIN_CONFIG_PARAM} ${PLUGIN_MENUITEM_PARAM} ${PLUGIN_CONFIG_SERVER}\""
51 echo "PLUGIN_MENUITEM_WORKDIR=\"${PLUGIN_MENUITEM_WORKDIR}\""
52 echo "PLUGIN_MENUITEM_ICON=\"${PLUGIN_MENUITEM_ICON}\""
53 }
54
55 autostart_plugin()
56 {
57 echo "PLUGIN_AUTOSTART=\"${PLUGIN_AUTOSTART}\""
58 echo "PLUGIN_MENUITEM_NAME=\"${PLUGIN_MENUITEM_NAME}\""
59 }
60
61 uninstall_plugin()
62 {
63 local i
64 for i in ${PLUGIN_PACKAGES}
65 do
66 if [[ -n $(magequery -n ${i}) ]]
67 then
68 MAGE_BOOTSTRAP=true mage uninstall ${i}
69 mage clean
70 fi
71 done
72
73 mage clean
74 }
75
76 case $1 in
77 install) install_plugin ;;
78 setup) setup_plugin ;;
79 menuitem) create_menuitem ;;
80 uninstall) uninstall_plugin ;;
81 autostart) autostart_plugin ;;
82 *) echo "PLUGIN '${PLUGIN_NAME}': unkown operation '$1'" ;;
83 esac