#!/bin/sh
ln -s /opt/maemo/usr/lib/hildon-desktop/advifswlib /usr/lib/hildon-desktop/advifswlib
update-sudoers
chmod +x /usr/bin/advifsw_wlan_off.sh
chmod +x /usr/bin/advifsw_wlan_on.sh

if [ "$1" = "configure" ]; then
  gconftool-2 --makefile-install-rule /usr/share/gconf/schemas/advanced-interface-switcher.schemas
  gconf-schemas --register advanced-interface-switcher.schemas 
fi

gtk-update-icon-cache -f /usr/share/icons/hicolor

DISABLED_DIR=/usr/share/applications/hildon-status-menu/disabled
if [ ! -d $DISABLED_DIR ]; then
  mkdir $DISABLED_DIR
fi

if [ -f $DISABLED_DIR/../connui-bluetooth.desktop ]; then
  mv $DISABLED_DIR/../connui-bluetooth.desktop $DISABLED_DIR/
fi

PLUGINS_CONFIG=/etc/hildon-desktop/status-menu.plugins
if [ ! -f $PLUGINS_CONFIG.ais ]; then 
  cp $PLUGINS_CONFIG $PLUGINS_CONFIG.ais
fi
sed -i 's/connui-bluetooth\.desktop/advanced-interface-switcher\.desktop/g' $PLUGINS_CONFIG
exit 0
