#!/bin/bash

# This is an ugly hack to fix the menu. This really should be done by
# the /etc/menu-methods/ion-metadome script, but I can't figure out how.

MENU_FILE="menu.conf"

if [ "${USER}" != "root" ]; then

    USER_LOCATION="${HOME}/.ion-devel"

else

    ROOT_LOCATION="/etc/X11/ion-devel"

fi

for LOCATION in ${ROOT_LOCATION} ${USER_LOCATION}; do

    sed -e "s|^submenu[ ].ION-METADOME.||" < ${LOCATION}/${MENU_FILE} > ${LOCATION}/${MENU_FILE}.tmp
    mv ${LOCATION}/${MENU_FILE}.tmp ${LOCATION}/${MENU_FILE}

done

exec /usr/X11R6/bin/ion-metadome

exit 0
