--- alx-src/branches/alxconf-060/plugins/egk_scm/plugin.sh 2012/04/20 14:05:48 3522 +++ alx-src/branches/alxconf-060/plugins/egk_scm/plugin.sh 2012/04/23 07:30:59 3523 @@ -1,4 +1,4 @@ -# this script gets included by config_sessions +# this script gets called by config_sessions PLUGIN_NAME="egk_scm" PLUGIN_MENUITEM_NAME="SUM_EGK" @@ -7,9 +7,16 @@ PLUGIN_MENUITEM_WORKDIR="" PLUGIN_MENUITEM_ICON="" -PLUGIN_AUTOSTART=1 - +PLUGIN_AUTOSTART=0 PLUGIN_PACKAGES="libusb libusb-compat pcsc-lite pcsc-plugin-ehealth200" +# uses rdesktop plugin config +PLUGIN_CONFIG="/etc/alxconfig-ng/plugin-rdesktop.conf" + +# include alx functions +source /etc/alxconfig-ng/config.rc +source /etc/alxconfig-ng/serial +source ${ALX_FUNCTIONS}/common +source ${ALX_FUNCTIONS}/mysqlfunctions install_plugin() { @@ -32,12 +39,25 @@ # create desktop buttons create_menuitem() { - if [ -f /etc/alxconfig-ng/plugin-rdesktop.conf ] + if [ -f ${PLUGIN_CONFIG} ] then - source /etc/alxconfig-ng/plugin-rdesktop.conf + source ${PLUGIN_CONFIG} + + # use session name from rdesktop if available + if [[ ! -z ${PLUGIN_CONFIG_SESSION_NAME} ]] + then + PLUGIN_MENUITEM_NAME="${PLUGIN_CONFIG_SESSION_NAME}" + fi + else + # rdesktop not configured, disable plugin + PLUGIN_CONFIG_PARAM="" + PLUGIN_CONFIG_SERVER="" + PLUGIN_MENUITEM_NAME="" + PLUGIN_MENUITEM_EXEC="" + PLUGIN_MENUITEM_PARAM="" + PLUGIN_MENUITEM_WORKDIR="" + PLUGIN_MENUITEM_ICON="" fi - [[ -z ${PLUGIN_CONFIG_PARAM} ]] && PLUGIN_CONFIG_PARAM="" - [[ -z ${PLUGIN_CONFIG_SERVER} ]] && PLUGIN_CONFIG_SERVER="" # don't touch these echo, define variables above echo "PLUGIN_MENUITEM_NAME=\"${PLUGIN_MENUITEM_NAME}\"" @@ -49,7 +69,22 @@ autostart_plugin() { - echo "PLUGIN_AUTOSTART=\"${PLUGIN_AUTOSTART}\"" + # only run autostart if rdesktop was configured + if [ -f ${PLUGIN_CONFIG} ] + then + source ${PLUGIN_CONFIG} + evaluate_table plugin_egk_scm + + # use session name from rdesktop if available + if [[ ! -z ${PLUGIN_CONFIG_SESSION_NAME} ]] + then + PLUGIN_MENUITEM_NAME="${PLUGIN_CONFIG_SESSION_NAME}" + fi + fi + # sanitize variables + [[ -z ${plugin_egk_scm_autostart} ]] && plugin_egk_scm_autostart=0 + + echo "PLUGIN_AUTOSTART=\"${plugin_egk_scm_autostart}\"" echo "PLUGIN_MENUITEM_NAME=\"${PLUGIN_MENUITEM_NAME}\"" }