Magellan Linux

Annotation of /alx-src/branches/alxconf-060/plugins/rdesktop/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: 1775 byte(s)
-added autostart support for plugins
1 niro 3391 # 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 niro 3503 PLUGIN_AUTOSTART=0
11    
12 niro 3391 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 niro 3492 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 niro 3391 return 0
35     }
36    
37     # create desktop buttons
38     create_menuitem()
39     {
40 niro 3492 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 niro 3391 # 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 niro 3492 echo "PLUGIN_MENUITEM_PARAM=\"${PLUGIN_CONFIG_PARAM} ${PLUGIN_MENUITEM_PARAM} ${PLUGIN_CONFIG_SERVER}\""
51 niro 3391 echo "PLUGIN_MENUITEM_WORKDIR=\"${PLUGIN_MENUITEM_WORKDIR}\""
52     echo "PLUGIN_MENUITEM_ICON=\"${PLUGIN_MENUITEM_ICON}\""
53     }
54    
55 niro 3503 autostart_plugin()
56     {
57     echo "PLUGIN_AUTOSTART=\"${PLUGIN_AUTOSTART}\""
58     }
59    
60 niro 3391 uninstall_plugin()
61     {
62     local i
63     for i in ${PLUGIN_PACKAGES}
64     do
65     if [[ -n $(magequery -n ${i}) ]]
66     then
67     MAGE_BOOTSTRAP=true mage uninstall ${i}
68     mage clean
69     fi
70     done
71    
72     mage clean
73     }
74    
75     case $1 in
76     install) install_plugin ;;
77     setup) setup_plugin ;;
78     menuitem) create_menuitem ;;
79     uninstall) uninstall_plugin ;;
80 niro 3503 autostart) autostart_plugin ;;
81 niro 3391 *) echo "PLUGIN '${PLUGIN_NAME}': unkown operation '$1'" ;;
82     esac