#!/bin/sh

  if [ "$1" = "configure" ]; then
    gconf-schemas --register advanced-power.schemas 
  fi

  [ -z  "$2" ] && gtk-update-icon-cache -f /usr/share/icons/hicolor

  cat <<EOF > /tmp/request-reboot.txt
  In order to complete Advanced Power install/upgrade device must be rebooted.
  Choose OK to reboot now or Cancel to reboot manually later.
  EOF

  maemo-confirm-text "Reboot device" /tmp/request-reboot.txt
  if [ $? == 0 ]; then
    ( sleep 1 ; run-standalone.sh /usr/bin/dbus-send --system --dest=com.nokia.mce --type=method_call /com/nokia/mce/request com.nokia.mce.request.req_reboot)&
  fi

  exit 0