#!/bin/sh
## ----------------------------------------------------------------------
## debian/postinst : postinstallation script for maemo-wordpy
## ----------------------------------------------------------------------

## ----------------------------------------------------------------------
set -e

ACCOUNTS_FILE=/home/user/.maemowordpy/accounts.conf
OLD_SETTINGS=/home/user/.maemowordpy/blog.dat
OLD_SETTINGS2=/home/user/.maemowordpy/settings.conf

if [ -f $OLD_SETTINGS ]
then 
  rm $OLD_SETTINGS
  echo "Deleting old configuration file."
fi

if [ -f $ACCOUNTS_FILE ]
then 
  rm $ACCOUNTS_FILE
  echo "Deleting old accounts.conf file"
fi

if [ -f $OLD_SETTINGS2 ]
then 
  rm $OLD_SETTINGS2
  echo "Deleting old settings.conf file"
fi

chown -R user:users /home/user/.maemowordpy
chmod +x /usr/bin/maemowordpy
echo "updated permiss"

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

oldversion="$2"
if [ -z "$oldversion" ]; then
  maemo-select-menu-location maemo-wordpy.desktop
fi

exit 0
